Good day. There is a simple markup with TextView and Button .
<LinearLayout android:id="@+id/LL2" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:layout_below="@+id/LL" > <TextView android:id="@+id/selected_item2" android:layout_width="wrap_content" android:layout_height="wrap_content" > </TextView> </LinearLayout> <LinearLayout android:id="@+id/LB" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button3" android:layout_gravity="bottom" /> </LinearLayout> Button resizes a TextView . How to make the button located at the bottom, not deformed when changing the size of the text, did not move down, disappearing from the screen, and was superimposed on top of the TextView ?
Full xml markup
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/LL" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Кнопка 1" android:layout_weight="1" android:background="@color/colorPrimary" android:textColor="@color/white" android:id="@+id/button" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Кнопка 2" android:layout_weight="1" android:background="@color/colorPrimary" android:textColor="@color/white" android:id="@+id/button2" /> </LinearLayout> <LinearLayout android:id="@+id/LL2" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:layout_below="@+id/LL" > <TextView android:id="@+id/selected_item2" android:layout_width="wrap_content" android:layout_height="wrap_content" > </TextView> </LinearLayout> <LinearLayout android:id="@+id/LB" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button3" android:layout_gravity="bottom" /> </LinearLayout> The first 2 buttons are located above the actionbar . But the problem is only with what I described above - with button3 and textview .
RelativeLayout, it should help you achieve your ideas. - ermak0ffTextViewandButtoninFrameLayout. And then how to set the location of theButton, and more it will not change. - Frozik6k