非常に簡単な質問があります。画面の右下の領域で、画面全体に大きな ImageView の上に小さなロゴを配置する必要がありますが、座標を設定する方法や、 ImageViews は相対的な位置にあります。
このようなもの:
非常に簡単な質問があります。画面の右下の領域で、画面全体に大きな ImageView の上に小さなロゴを配置する必要がありますが、座標を設定する方法や、 ImageViews は相対的な位置にあります。
このようなもの:
これを試して
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
出力
フレームレイアウトを使用します。
Google ブログスポットのサンプルによると
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</FrameLayout>
次の出力が得られます
ニーズに合わせて調整するだけです。