【问题标题】:EditText inside a ScrollView display keyboardScrollView 显示键盘内的 EditText
【发布时间】:2013-04-10 10:33:37
【问题描述】:

我有这个布局

<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"
tools:context=".MainActivity" >



<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <EditText
            android:id="@+id/editText1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10" >

        </EditText>

        <EditText
            android:id="@+id/editText2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10" />

        <Button
            android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Button" />

    </LinearLayout>
</ScrollView>

</LinearLayout>

..当我执行我的应用程序时,会显示键盘。

http://img62.imageshack.us/img62/2879/screenshot2013041012264.png

如果我不使用滚动视图,除非我单击一个编辑文本,否则不会发生这种情况。

我不想在执行我的应用程序时显示键盘(具有滚动视图),除非我单击编辑文本。

有什么想法吗?

谢谢!

【问题讨论】:

    标签: android keyboard android-edittext scrollview


    【解决方案1】:

    您可以将 android:windowSoftInputMode="stateHidden" 放在 Manifest 文件的 Activity 标签中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-21
      • 1970-01-01
      • 1970-01-01
      • 2013-08-23
      • 2021-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多