こんにちは、レイアウトの中心から10dpのImageViewを配置したいと思います。私にそれをするように提案してください。RelativeLayout を使用しています。
質問する
1820 次
2 に答える
3
以下を試してください:
<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_centerHorizontal="true" // <--Sets to Horizontally center
android:layout_centerVertical="true" // <--Sets to Vertically center
android:paddingRight="10dp" // <--- Sets space of 10dp at rigth, so displays to left
android:src="@drawable/ic_launcher" />
</RelativeLayout>
于 2012-07-18T13:12:37.323 に答える
1
于 2012-07-18T13:08:38.083 に答える