If I want to set the image at the bottom of any screen, we can use android:layout_alignParentBottom="true" in the relative layout. But for some reason I must use LinearLayout. Other buttons (button, image button, list) are also displayed on the screen. I want to place an image at the bottom of the screen. Whatever the situation, the user will be able to see this image at the bottom of the screen. How to achieve alignParentBottom="true" property in LinearLayout. See the following xml sample. I use example1.xml, but I want to look at the file from example2.xml too
example1.xml

<?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="fill_parent"> <TextView android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="40dip" android:background="#ffffff" android:textColor="#000000" android:text="I am sunil" android:gravity="bottom"/> </LinearLayout>
example2.xml
< ?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="40dip" android:background="#ffffff" android:textColor="#000000" android:text="I am sunil" android:layout_alignParentBottom="true"/> </RelativeLayout>
thanks
Sunil kumar sahoo
source share