Android中的调整和调整盘的区别?我试图编写一个代码,用于在以下情况下重新调整ui组件的大小。软键盘出现了。当我用调整大小,它重新调整了ui组件的大小,同时也对用户界面组件进行了调整。调节盘给了我同样的输出。我想知道它们之间的区别,以及何时使用每个组件?哪一个(调整盘或调整大小)对调整UI有好处?以下是我的XML:<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<EditText
android:id="@+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:ems="10"
android:inputType="textPersonName" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:text="My Button" />
</LinearLayout>
</RelativeLayout></ScrollView>
3 回答
BIG阳
TA贡献1859条经验 获得超6个赞
“调整大小”
活动的主窗口总是调整大小,以便为屏幕上的软键盘腾出空间。 “调整盘”
活动的主窗口不会调整大小,以便为软键盘腾出空间。相反,窗口的内容会自动平移,这样当前的焦点就不会被键盘遮住,用户总是可以看到他们正在键入的内容。这通常不如调整大小,因为用户可能需要关闭软键盘才能到达窗口的模糊部分并与之交互。
<activity android:windowSoftInputMode="adjustResize"> </activity>
- 3 回答
- 0 关注
- 326 浏览
添加回答
举报
0/150
提交
取消