use*_*676 5 android android-layout
我有多行EditText和它下面的一个提交按钮。
当用户点击EditText区域时,出现软键盘。
它上面有一个Enter键,使用户可以移动到下一行。
我的问题是软键盘隐藏了我的提交按钮-因此,当用户完成编辑后,他/她必须按下设备上的后退按钮以隐藏要提交的软键盘。
有什么办法可以在键盘上同时保持输入和完成按钮吗?或者,还有其他更好的解决方案吗?
提前致谢。
是的,您可以使用布局,其中按钮始终位于页面底部但位于键盘顶部,如下所示
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/button_save"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:enabled="false"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:text="@string/button_save" />
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@+id/button_save"
android:fadeScrollbars="false"
>
...all your stuff here
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1919 次 |
| 最近记录: |