Repository navigation
Closed
Labels
area/commandbarCategorizes an issue or PR as relevant to CommandBardifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't workingplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/layout 🧱Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Description
Current behavior
The Command bar doesn't show up properly in WASM and Android
-
WASM
--Commandbar is visible, but Icons are clipped(not 100% reproducible)
--

-- Opening the Secondary Commands does "nothing" and freeze theCommandBar -
Android
-- Command bar is visible, but shows the Secondary Commands
--

Expected behavior
-
WASM
-- don't freeze after opening the secondary commands -
Android
-- Show all AppBarButtons
How to reproduce it (as minimally and precisely as possible)
Sample project :
CommandBar.zip
Environment
Nuget Package:
Package Version(s):
Affected platform(s):
- iOS
- Android
- WebAssembly
- Windows
- Build tasks
Visual Studio
- 2017 (version: )
- 2019 (version: )
- for Mac (version: )
Relevant plugins
- Resharper (version: )
Anything else we need to know?
Metadata
Metadata
Assignees
Labels
area/commandbarCategorizes an issue or PR as relevant to CommandBardifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't workingplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/layout 🧱Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Activity
ghuntley commentedon Sep 10, 2019
Howdy @crogeniks.
The clipping on symbols on WebAssembly is likely related to #1332 or #693. Maintenance of glyphs is currently quite manual and there's a issue open over at #967 to automate the processes.
In case you missed it - CommandBar has two modes, on Android it can't be fully customized like other templatable controls would. By switching to
XamlDefaultCommandBaryou can replicate UWP's CommandBar. It is templatable and supports a template that's almost identical to UWP's default CommandBar.Thanks for providing a repro, will need to revisit this at a later date as we are busy preparing for UnoConf. I see you are from Montreal - will see you there?
ps. The following are worth checking out if you intend to send in a pull-request:
pkar70 commentedon Sep 10, 2019
How can I change CommandBar mode to XamlDefaultCommandBar?
pkar70 commentedon Sep 10, 2019
And, in SecondaryCommands, AppBarToggleButton is not shown (only AppBarButton). At least in Android.
TopperDEL commentedon Sep 10, 2019
I've asked me the same Question just a second ago. The documentation talks About different modes, but it is not clear how to set them.
ghuntley commentedon Sep 10, 2019
That's good feedback — have raised issue to improve clarity of the documentation. The modes can be switched between by changing the control templates.
The default modes for Uno are configured via
uno/src/Uno.UI/UI/Xaml/Style/Generic/GenericStyles.cs
Line 25 in 935a845
pkar70 commentedon Sep 10, 2019
But...
<Page.Resources>
<Style TargetType="CommandBar" BasedOn="NativeDefaultCommandBar" />
</Page.Resources>
ends with:
Implicit styles in inline resources are not supported (Page, Line 1:2)
So, where to place this Style?
davidjohnoliver commentedon Sep 10, 2019
@pkar70 You need to put it in a standalone
ResourceDictionaryfile or inApplication.Resources.TopperDEL commentedon Sep 10, 2019
This is still not working for me. It keeps saying "The property Binding.BasedOn is unkown."
pkar70 commentedon Sep 12, 2019
Seems like (on Android) only buttons with image icon are supported, at least within CommandBar (as AppBarButton with FontIcon is supported, but CommandBar implementation doesn't use AppBarButton implementation).
I changed CommandBar to AppBar with StackPanel full of AppBarButtons and it works*. Although for SymbolIcon you have to apply workaround (till next Uno.Ui release), changing it to FontIcon:
e.g. change
to
*) almost works, as it displays probably "..." icon on right, and this icon doesn't work.
HaoLife commentedon Sep 23, 2019
NativeDefaultCommandBar needs conditional compilation, he only supports ios and Android
scpc0609 commentedon Oct 20, 2019
If I use the below code, it does not compile and code generation fails.
<Style TargetType="CommandBar" BasedOn="NativeDefaultCommandBar" />If I use the below code, it does compile but crashes the App at start.
<xamarin:Style TargetType="CommandBar" xamarin:BasedOn="{StaticResource XamlDefaultCommandBar}"/>I get exception at runtime: "The resource XamlDefaultCommandBar cannot be found".
What is the proper way to enable XamlDefaultCommandBar.
Also is there a guidance for people who want to create their own implementation of CommandBar without using any of the two variants available?
ramezgerges commentedon Aug 7, 2023
This isn't reproducing for me on Android or WASM, although there is a (probably separate) clipping issue that I just opened.
chore: add Material style for RadioMenuFlyoutItem (unoplatform#1509)