【问题标题】:How I can do scroll in view while keypad is open in android?在android中打开键盘时如何在视图中滚动?
【发布时间】:2013-02-15 09:25:28
【问题描述】:

我在滚动视图中有许多edittext,当它们超过屏幕容量时,当键盘打开时很难执行平滑滚动。这是我的代码。

     <ScrollView 
   android:layout_width="match_parent"
   android:layout_height="match_parent"
    >
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:orientation="vertical"   
    >
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
    </LinearLayout>
</ScrollView>

如果有人知道,请用一个很好的链接指导我或回答同样的问题。

谢谢

【问题讨论】:

    标签: android android-layout android-scrollview android-keypad


    【解决方案1】:

    android:windowSoftInputMode="adjustResize" 放在清单文件中的活动标签上。

    它会起作用的。

    【讨论】:

      【解决方案2】:

      使用

       android:focusable="true" 
              android:focusableInTouchMode="true"
      

      在线性布局内。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-02-08
        • 1970-01-01
        • 1970-01-01
        • 2017-01-08
        • 1970-01-01
        相关资源
        最近更新 更多