画像を任意の画面の一番下に設定する場合は、相対レイアウトでandroid:layout_alignParentBottom="true"
を使用できます。しかし、何らかの理由で私はLinearLayoutを使用する必要があります。画面には他のビュー(ボタン、画像ボタン、リストビュー)もあります。私は画面の下に画像を配置したい。どのような状況であっても、ユーザーはこの画像ビューを画面の下部で見ることができます。 LinearLayoutのalignParentBottom="true"
プロパティの取得方法folowingサンプルxmlを参照してください。私はexample1.xmlを使用していますが、私はexample2.xmlのことを見て、ファイルLinearLayoutのalignParentBottom = "true"プロパティを実現する方法
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>
たいおかげで
に追加私は=「ボトム」重力を使用していたが、私はrelativelayout –
にalignParentBottom =「true」をに取得していますと、私は同じ効果を得ることはありませんでしたがとしての私の答え –
をチェック私はそのレイアウトで1つのイメージだけではないことを述べました。ギャラリービュー、リストビューもあります –