我在应用程序的其他地方有对话框,它们工作得非常好(键盘不会隐藏视图),但是在我编写的这个特定的新对话框中,当键盘打开时,它并不会将视图向上移动。 我想不出为什么...
我的对话框布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/MyLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"
android:background="@drawable/dialog_background"
android:clickable="true"
android:orientation="vertical"
custom:maxHeight="@dimen/dialog_max_height"
custom:maxWidth="@dimen/dialog_max_width" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="something" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<EditText
android:id="@+id/SomeEditText"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:minHeight="100dp"
android:layout_margin="15dp"
android:background="#ffffff"
android:gravity="right|top"
android:inputType="textMultiLine"
android:singleLine="false"
android:textColor="@color/edit_text_text_color"
android:textSize="16dp" />
</LinearLayout>
<Button
android:id="@+id/SomeButton"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_button_height"
android:layout_margin="15dp"
android:text="text" />
</LinearLayout>
I have
android:windowSoftInputMode="adjustPan" >
在我的清单文件中设置。
android:windowSoftInputMode="adjustPan"
。但是在应用程序中的其他对话框中它可以正常工作,所以我认为这与此无关。我也尝试了adjustResize
,但没有帮助。 - BVtpandroid:windowSoftInputMode="adjustResize"
。 - Sohail Zahid