C1ComboBox drop-down not shrinking to number of items on iOS

Posted by: jared.fritsch on 20 December 2017, 4:14 am EST

    • Post Options:
    • Link

    Posted 20 December 2017, 4:14 am EST

    In iOS, if there are only a few items, the drop-down height is not shrinking down to only encapsulate the rows. It is showing empty rows. See screenshot below. In the example below, Android and UWP both shrink the drop-down to only show the two items. Is this a limitation of iOS or is this behavior not expected? I see that I can set the height of the drop-down. As long as the height of the drop-down is less than or equal to the height of all the rows, the extra blank rows do not show up. However, that would require some math every time I set the ItemSource ({NumberOfRows} x {RowHeight}) and I don’t see a property for row height.

  • Posted 20 December 2017, 4:16 am EST

    I should mention this was tested on v2.5.20173.238.

  • Posted 20 December 2017, 6:08 am EST

    I mentioned it to the devs, and I’ll let you know what they say.

    Kelley

  • Posted 2 April 2018, 12:38 am EST

    Hi Jared

    This bug is fixed in build 2.5.20181.267 which is available via NuGet.

    Thanks

    Kelley

  • Posted 12 April 2018, 6:38 pm EST

    Hi Kelley,

    I updated my version of Xamarin Studio to the latest build 2.5.20181.267 but I am still seeing this behavior if the number of items in the datasource is less than 4. It still shows the same behavior as before. Can you please confirm if this has been fixed.

    Thanks,

  • Posted 13 April 2018, 12:34 am EST

    I just retested this with a small number of items (I tried 2) and it’s definitely fixed in build 267. If you’re having issues check to see if you’re setting a MinDropDownHeight since this will set a bound on how much the control can shrink. Also keep in mind that this only applies when using DropDownModes other than FullScreen since it doesn’t make sense in that context.

    Kelley

  • Posted 15 April 2018, 7:04 pm EST

    Hi Kelley,

    I would like to know the difference between DropDownHeight and MinDropDownHeight. I have never used MinDropDownHeight in my projects but only set DropDownHeight to 250 for all the controls to give a uniform look and feel.

    After removing this property I am able to see that the height shrinks to fit 2 to 4 rows only depending on the number of values in the data source.

    Thanks,

  • Posted 16 April 2018, 12:28 am EST

    MinDropDownHeight and MaxDropDownHeight use automatic sizing, but set a barrier for a min and max size of the DropDown. DropDownHeight on the other hand does not use autosizing and instead gives the DropDown a fixed size.

    Kelley

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels