Xamarin app layout is not good on different android device?

Xamarin app layout is not good on different android device?

Hello Friends,
I have create a simple cross platform android app but it's layout is not in proper manner. On some of mobiles it is ok but with others it's not good. somewhere labels, textboxes and buttons are so small and somewhere they are so large.

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Could your provide your code and the resolution of android device about your issue?
    Which kind of platform that you used? Xamarin android or Xamarin forms?

    If you use xamarin forms. Normally the layout should adapt to different screensizes autimatically.

    If you use xamarin android. We aren't supposed to use fixed values that on layouts like following code, unless you always want them that size. You would want to use things such as wrap_content/match_parent generally.

        <ImageButton
                android:background="@android:color/background_light"
                android:src="@drawable/ic_"
                android:layout_width="51.0dp"
                android:layout_height="50.5dp"
                android:id="@+id/Bu1"
                android:layout_marginTop="42.0dp"
                android:layout_marginLeft="64.0dp" />
    
Sign In or Register to comment.