Forum Cross Platform with Xamarin

How to set RowHeight on a ListView on various platforms?

IgorPerunovicIgorPerunovic USUniversity
edited December 2016 in Cross Platform with Xamarin

I'm using static resources defined in XAML, and I need one for my row heights on various ListViews. I also need it to be different on each platform.

So, I tried this in XAML:

 < x:Int32  
              < OnPlatform x:TypeArguments="x:Int32"
                                                    WinPhone="120" />  

            </ x:Int32 > 

and elsewhere:

< ListView RowHeight="{StaticResource RowHeight1}" >
</ ListView >

However, I found this to work on UWP, but not on Android. On Android, I just can't see the ListView.
When I just use
< x:Int32 x:Key="RowHeight1" >
< /x:Int32 >

it works fine on Android, but it's not what I need (I need it to be different on UWP.

Can anyone help me with this?
(Also, I had to change the XAML a bit for it to show, for some reason it wouldn't show in my post before the added spaces)


Sign In or Register to comment.