Может ли кто-нибудь помочь мне.Мне нужна кнопка внизу экрана.Для относительного макета я могу использовать
android: layout_alignParentBottom = "true"
Но что использовать, если я использую линейный макет.Пожалуйста, помогите
вы можете попробовать что-то вроде этого
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1.0"> </LinearLayout> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Button"> </Button> </LinearLayout>
<?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" android:orientation="vertical" android:gravity="bottom"> <Button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Button"/> </LinearLayout>