机器人:如何对齐按钮的底部和键盘上方时,它是吗? [英] Android: How to align button to the bottom and above the keyboard when it is up?

查看:179
本文介绍了机器人:如何对齐按钮的底部和键盘上方时,它是吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
<EditText
    android:id="@+id/editTextTitle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/task_title"
    android:ems="10" >

    <requestFocus />
</EditText>

<RelativeLayout android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true">
<Button
    android:id="@+id/buttonSeven"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="7" />

</RelativeLayout>

试图在屏幕的底部对齐的几个按钮。然而,当键盘弹出,我想按钮移动到键盘上方。那怎么办?

Trying to align a few buttons at the bottom of the screen. However when the keyboard pops up, I want the buttons to move up to above the keyboard. How to do that?

推荐答案

在您的Andr​​oidManifest.xml中只需添加这个属性:
的android:windowSoftInputMode =adjustResize

In your AndroidManifest.xml just add this attribute: android:windowSoftInputMode="adjustResize"

<activity 
            android:windowSoftInputMode="adjustResize"
            android:name="com.example.stackoverflow.SimpleActivity5" >

这篇关于机器人:如何对齐按钮的底部和键盘上方时,它是吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆