画像の x 座標と y 座標に関して、ImageView の画像の上に TextView と Button でレイアウトをオーバーレイする方法
2 に答える
0
Android とレイアウトの優れたリソースは、http: //www.learn-android.com/2010/01/05/android-layout-tutorial/です。それぞれのlayout_x
とlayout_y
は、プログラムで設定することもできます。
于 2012-11-21T12:28:04.353 に答える
0
FrameLayout をメイン コンテナーとして使用し、マージンを使用してすべての要素を内部に配置します。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_marginTop="60dp"
android:text="A text"
/>
</FrameLayout>
于 2012-11-21T12:28:14.927 に答える