Page 1 of 2
ComboBox and Mobile
Posted: 24 Jan 2025, 16:39
by gjacob-RCG
Hi,
I'm working on a project using Unity, Noesis and Visual Studio.
For this project,I created a style for the ComboBox control.
I added in a xaml and set the MaxDropDownHeight.
<ComboBox Width="800" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 250 0 0" MaxDropDownHeight="420">
I tested the result with Visual and Unity for the PC platform and had no problems.
But When I tested on mobile (Android & iOS), the popup of the comboBox is cut off (see picture).
(On the picture, the green area represents the location of the combobox when it is open)
Are there any constraints specific to mobile for comboBox?
Re: ComboBox and Mobile
Posted: 24 Jan 2025, 21:06
by KeldorKatarn
Hi,
I'm working on a project using Unity, Noesis and Visual Studio.
For this project,I created a style for the ComboBox control.
I added in a xaml and set the MaxDropDownHeight.
<ComboBox Width="800" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 250 0 0" MaxDropDownHeight="420">
I tested the result with Visual and Unity for the PC platform and had no problems.
But When I tested on mobile (Android & iOS), the popup of the comboBox is cut off (see picture).
(On the picture, the green area represents the location of the combobox when it is open)
Are there any constraints specific to mobile for comboBox?
The size of the popup is not related to the size of the ComboBox control. It's a separate element on a different layer. So that might be a styling thing. You should check the ControlTemplate. Setting the Width and Height of the ComboBox doesn't affect the Dropdown Popup size necessarily. That depends on how the control template is written.
Re: ComboBox and Mobile
Posted: 27 Jan 2025, 09:35
by gjacob-RCG
Hi KeldorKatarn,
In my ControlTemplate, I apply the combobox values to width and height.
I've even tried replacing templateBinding with fixed values, but the result is the same.
But maybe I didn't do it properly.
Below is the popup code in my style.
<Popup
Name="Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">
<Grid Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder" Background="Gray" CornerRadius="10" />
<ScrollViewer Margin="15 5 30 5" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
Re: ComboBox and Mobile
Posted: 30 Jan 2025, 10:53
by sfernandez
Are there any constraints specific to mobile for comboBox?
No, the code is the same for all platforms. The only limitation is given by the View (the surface) size.
Could you connect the Inspector and investigate the sizes of the parent elements of the drop down, to see if there is any unexpected Height or MaxHeight?
Re: ComboBox and Mobile
Posted: 03 Feb 2025, 12:32
by gjacob-RCG
Hi sfernandez,
I checked with Noesis inspector and all the values (ActualWidth & ActualHeight) are indeed those defined as desired.
I can't understand why the popup UI is cut off as if there were a mask, but that's not the case.
Re: ComboBox and Mobile
Posted: 04 Feb 2025, 11:29
by sfernandez
Could you please provide a RenderDoc capture of a frame showing the ComboBox dropdown in that device?
Re: ComboBox and Mobile
Posted: 05 Feb 2025, 14:41
by gjacob-RCG
I created a NoesisGUI Issue Tracker and I have attached the RenderDoc capture of a frame showing the ComboBox dropdown for google pixel 8 pro & the xaml for my ComboBox Style.
https://www.noesisengine.com/bugs/view.php?id=3934
Re: ComboBox and Mobile
Posted: 07 Feb 2025, 20:16
by alexk
Any chance you're applying a ScaleTransform to the combobox or its parent panels, say, to fit to different screen resolutions?
I had a similar issue before and that was the reason in my case.
Re: ComboBox and Mobile
Posted: 10 Feb 2025, 10:10
by gjacob-RCG
Hi Alexk,
I don't use ScaleTransform but Viewbox so that the xaml content remains in 16:9 format whatever the screen.
Re: ComboBox and Mobile
Posted: 17 Feb 2025, 19:05
by sfernandez
If you remove the Viewbox, does the ComboBox dropdown show without clipping?