I am stuck in a problem and I do not know what causes it. I have a very simple layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/my_text_view" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="NOTE_THIS" android:textColor="#FFFFFF" android:textSize="22dp" android:text="TestText"/> </LinearLayout>
which is included in another layout. If I change the gravity inside xml, I see the same result in the layout editor and on my phone. If I want to apply Gravity programmatically, as with myTextView.setGravity(Gravity.CENTER) , this will not change anything. And I can not install LayoutGravity in Java on TextView
I will try for debugging purposes to enable them three times each with a different severity that even works. Therefore, I assume that everything is in order with my layout, and there should be a Bug or something else that I missed. Can someone give me a hint that I can also try, or what causes this problem?
Rafael t
source share