【问题标题】:Android keyboard blocking app componentsAndroid 键盘阻止应用程序组件
【发布时间】:2014-09-18 17:57:52
【问题描述】:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.myapp.MainActivity" >

    <TextView
        android:id="@+id/txtWelcome"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="151dp"
        android:padding="5dp"
        android:text="@string/Welcome"
        android:textSize="30sp" />

    <TextView
        android:id="@+id/SignUp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/txtWelcome"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="24dp"
        android:text="@string/SignUp" />

    <Button
        android:id="@+id/btnContinue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/etUsername"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="14dp"
        android:text="@string/Continue" />

    <EditText
        android:id="@+id/etUsername"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/btnContinue"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="19dp"
        android:layout_marginLeft="20dp"
        android:ems="10"
        android:hint="Enter your email" >

        <requestFocus />
    </EditText>

</RelativeLayout>

当我单击编辑文本进行输入时,键盘会打开并阻止按钮,即当键盘显示在屏幕上时,我看不到 EditText 下方的按钮。

我尝试在线搜索,但发现是使用这些: android:windowSoftInputMode="adjustPan" 或 android:windowSoftInputMode="adjustResize" 但没有一个达到目的。

我正在自学 Android,因此我们将不胜感激。 提前致谢。

【问题讨论】:

    标签: xml android-layout


    【解决方案1】:

    您是否在有问题的 EditText(s) 上尝试过 android:imeOptions="flagNoExtractUi" ? http://developer.android.com/guide/topics/ui/controls/text.html#Flags

    【讨论】:

    • 嗨@Snowlnferno ..谢谢你的回复..这不是我打算在我的应用程序中做的事情..我想要我的应用程序下方的键盘,即当我点击EditText时,键盘不应隐藏应用程序中的按钮...当键盘在屏幕上时,我也想看到该按钮....但是您的链接帮助我学习了 2 个新事物..所以也感谢您的链接。跨度>
    猜你喜欢
    • 2013-08-23
    • 2018-11-10
    • 2022-01-12
    • 1970-01-01
    • 2012-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多