在一个布局中我用一个EditText,下面也有布局,当我点击输入时,弹出虚拟键盘时,EditText下面的布局也能显示出来,在网上找了找,大致有两种解决方案,第一种是在定义Activity时设置职下属性:
<activity
android:name="ViewActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustUnspecified|stateHidden"
android:configChanges="orientation|keyboardHidden">
</activity>
另一种就是在EditText的下面加上一个ScrollView。
我用第一种方法没有解决我的问题,就用了第二个,问题解决了,只是不明白什么原理,哪位大牛能帮我解释一下,这是为什么?
下面是我解决的方法,只是其中一部分,整体是一个相对布局,里面有一个EditText控件,还有EditText下面的三个按钮,只是在EditText和三个按钮之间加了一个ScrollView:
<EditText
android:id="@+id/wb_sendMsg_editText1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/wb_sendMsg_button01"
android:layout_below="@id/wb_sendMsg_title"
android:layout_centerVertical="true"
android:background="@color/white"
android:gravity="top"
android:hint="@string/text_hint" >
</EditText>
<ScrollView
android:id="@+id/wb_sendMsg_scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ScrollView>
哪位大神帮忙解释一下,万分感谢!