私はAndroidのダイアログについて学んでいますが、その高さを決めるのは混乱しています。私はこのXMLを私のダイアログレイアウトに使用しています。 。 。Androidのカスタムダイアログの高さ
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/AButton"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="Click Me to Dismiss"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toLeftOf="@id/AButton"
android:text="Click this button: "
/>
<ImageView
android:id="@+id/an_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="42px"
android:src="@drawable/screw50">
</ImageView>
/>
このダイアログが表示されます。 。 。
しかしDeveloper.Android.com氏は述べています...その
"ビューがその内容(プラスパディング)を囲むのに十分なだけ大きいことを望んでいることを意味し WRAP_CONTENT、"...なぜダイアログはそれほど高い必要がありますか?私は
android:layout_height="200px"
とレイアウトの高さを交換する場合
それが適切に短いダイアログになりますが、私は(それは良い習慣ではありません)、明示的なピクセルの高さを使用する必要はありません。どのようにしてダイアログの内容を十分大きくするには?
こんにちは私の質問はopsの問題でした。私は周りをブラウジングし、このポストに着いた。実際には、できるだけ多くのスペースを取るダイアログが欲しい。これは正しいレイアウトですか? – Naveed
この例では、RelativeLayoutをfill_parentに設定すると思われます。 – AndrewKS