【问题标题】:virtualkeyborad hidden Edittext虚拟键盘隐藏编辑文本
【发布时间】:2015-05-08 09:40:08
【问题描述】:

我有一个问题,我正在创建论坛,当我插入帖子时,如果我给 EditText 来写,我得到了虚拟键盘,我看不到你写的内容。

任何人都知道如何提高没有被虚拟键盘隐藏的 EditText

这是我的 xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
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.aulasg.Foros" >


<ListView
    android:id="@+id/lvForoTemas"
    android:layout_width="match_parent"
    android:layout_height="392dp" >

</ListView>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <EditText
        android:id="@+id/comentarioMensaje"
        android:layout_width="281dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.49"
        android:ems="10" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="0.49"
        android:onClick="insertarComentario"
        android:text="Button" />

  </LinearLayout>

</LinearLayout>

【问题讨论】:

  • 尝试在 AndroidManifest.xml 的 Activity 标记中添加此属性 android:windowSoftInputMode="adjustResize|stateAlwaysHidden" 或尝试发布您的 AndroidManifest.xml 代码。

标签: android android-edittext hidden virtual-keyboard


【解决方案1】:

在您的 AndroidManifest.xml android:windowSoftInputMode="adjustPan" 中为您的活动添加以下代码

【讨论】:

  • 谢谢,但它不起作用:S 有人可以帮我吗?
【解决方案2】:

你应该把这行:android:windowSoftInputMode="adjustPan"

在你的清单文件中的Activity:

<activity
        android:name=".Name_of_your_ativity"     
        android:label="@string/title_activity"
        android:windowSoftInputMode="adjustPan" >
</activity>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-01
    • 1970-01-01
    • 2019-06-08
    • 2014-03-19
    • 2010-12-31
    • 1970-01-01
    • 2019-02-07
    相关资源
    最近更新 更多