画面からボタンを押して:アンドロイドカスタムダイアログは、私がこのようなレイアウトでカスタムダイアログを持つ
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mylayout">
<LinearLayout
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView ... />
<TextView .../>
</LinearLayout>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title">
<LinearLayout ...>
<TextView ...
android:text="lots of text........" />
<TextView .../>
</LinearLayout>
</ScrollView
<RelativeLayout ...
android:layout_below="@+id/scrollView">
<Button ...>
<Button ...>
</RelativeLayout>
</RelativeLayout>
私の問題はscrollviewがあるということであるscrollviewでも多くのテキストがある場合には、下のボタンがダイアログから押し出されます。私はアンドロイドを使用してボタンを含むRelativeLayoutをアンカーすることによってそれを防ぐことができました:layout_alignParentBottom = "true"しかし、スクロールビューにテキストが少なくても、私はそれを望んでいない。
は、どのように私はこのようなレイアウトを取得することができます:
[SOME TEXT]
[Scrollable region]
[Buttons]
それも持つ線形レイアウトコンテナを使用して、異なる画面サイズや向き –
のような主要なレイアウトの高さを固定してくださいweight = 1属性の場合、ボタンはまだ押し下げられ、途中で切り取られます。ですから、少し上手いですが、完全な解決策ではありません... –