I'm facing a strange issue in my project when creating a simple xml design as follow:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#FF0000"
android:layout_marginLeft="30dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button"
android:layout_gravity="left|center_vertical"/>
Now see the difference, this is the view in 4.2.2 :
And this one in 2.3.3:
Would appreciate if someone can help me with it. thanks
It works, if you change it to this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:background="#FF0000"
android:orientation="vertical" >
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="New Button" />
</LinearLayout>
(I think I know why it behaves like this, let me just check something. I'll add an explanation later on)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With