gjacob-RCG
Topic Author
Posts: 5
Joined: 03 Oct 2024, 14:34

ComboBox and Mobile

24 Jan 2025, 16:39

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)
Image

Are there any constraints specific to mobile for comboBox?
 
KeldorKatarn
Posts: 234
Joined: 30 May 2014, 10:26

Re: ComboBox and Mobile

24 Jan 2025, 21:06

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)
Image

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.
 
gjacob-RCG
Topic Author
Posts: 5
Joined: 03 Oct 2024, 14:34

Re: ComboBox and Mobile

27 Jan 2025, 09:35

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>
 
User avatar
sfernandez
Site Admin
Posts: 3198
Joined: 22 Dec 2011, 19:20

Re: ComboBox and Mobile

30 Jan 2025, 10:53

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?
 
gjacob-RCG
Topic Author
Posts: 5
Joined: 03 Oct 2024, 14:34

Re: ComboBox and Mobile

03 Feb 2025, 12:32

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.
 
User avatar
sfernandez
Site Admin
Posts: 3198
Joined: 22 Dec 2011, 19:20

Re: ComboBox and Mobile

04 Feb 2025, 11:29

Could you please provide a RenderDoc capture of a frame showing the ComboBox dropdown in that device?
 
gjacob-RCG
Topic Author
Posts: 5
Joined: 03 Oct 2024, 14:34

Re: ComboBox and Mobile

05 Feb 2025, 14:41

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
 
alexk
Posts: 4
Joined: 26 Aug 2023, 21:01

Re: ComboBox and Mobile

07 Feb 2025, 20:16

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.
 
gjacob-RCG
Topic Author
Posts: 5
Joined: 03 Oct 2024, 14:34

Re: ComboBox and Mobile

10 Feb 2025, 10:10

Hi Alexk,
I don't use ScaleTransform but Viewbox so that the xaml content remains in 16:9 format whatever the screen.

Who is online

Users browsing this forum: No registered users and 3 guests