【发布时间】:2016-12-21 09:40:18
【问题描述】:
我在应用程序的其他地方有对话框,它们工作得很好(键盘不会隐藏视图),但是在我写的这个特殊的新对话框中,当键盘打开时它不会向上移动视图。我不知道为什么..
我的对话框布局:
<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>
我有
android:windowSoftInputMode="adjustPan" >
在我的清单中设置。
【问题讨论】:
-
显示你的清单文件。
-
我有
android:windowSoftInputMode="adjustPan"。但它在应用程序的其他对话框中工作得很好,所以我认为这与它没有任何关系。我也尝试了adjustResize,但没有帮助 -
在清单中的活动中尝试此属性
android:windowSoftInputMode="adjustResize" -
我写过我试过了,但不幸的是没有帮助
标签: android layout view keyboard