Obtain different result on emulator and real device xamarin android

Shay Wilner 1,746 Reputation points
2023-02-12T19:56:11.1033333+00:00

Hello

I debug an simple xml and i get different result

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:fontFamily="calibri"
        android:textColor="#fffdeca6"
        android:background="@drawable/gradient"
        android:textSize="23sp"
        android:textStyle="bold"
        android:layout_marginTop="12dp"
        android:capitalize="none"
        android:inputType="none" 
        android:text="@string/title"
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/message"
        android:layout_alignParentLeft="true"
        android:background="#ffdde7a6"
        android:textSize="24dp"
        android:id="@+id/mybutton"
       android:text="@string/button1"
        />
    <Button
        android:id="@+id/nexttime"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/mybutton"
       android:text="@string/button2"
         android:textSize="24dp"
         android:background="#ff7de7a6"
        />
</RelativeLayout>

the result of emulator pixel 5 api 28

testemulator

and the real device samsung galaxy a13

Screenshot_20230212-213550_test[1]

Developer technologies | .NET | Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Shay Wilner 1,746 Reputation points
    2023-02-15T12:41:16.55+00:00

    It's not a bug but due to default language if your default language is writting from right to left then all the icons change from left to right .for ex if you use a linear layout in horizontal direction the first item you add will be aligned to the right

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.