栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

显示软键盘时无法使ScrollView滚动

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

显示软键盘时无法使ScrollView滚动

android:windowSoftInputMode="adjustResize"
<activity>

标签添加到您的AndroidManifest.xml中。这将导致屏幕被调整为显示软件键盘后剩余的空间。结果,您将能够滚动,因为屏幕不会以任何方式被键盘覆盖。

编辑:

我已经写了一个最小的示例并对其进行了测试。除非有巨大的误解,否则请尝试下面的代码,然后找出为什么您的代码不起作用:

xml布局:

<?xml version="1.0" encoding="utf-8"?><ScrollView    xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_height="fill_parent"    android:layout_width="fill_parent"    >    <LinearLayout        android:orientation="vertical"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        >        <TextView android:layout_height="2000dp" android:layout_width="wrap_content" android:gravity="top" android:text="Scroll Down!"/>        <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:hint="Enter Text" />    </LinearLayout></ScrollView>

表现:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example"          android:versionCode="1"          android:versionName="1.0">    <uses-sdk android:minSdkVersion="15"/>    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">        <activity android:name="MyActivity"       android:label="@string/app_name"     android:windowSoftInputMode="adjustResize"     > <intent-filter>     <action android:name="android.intent.action.MAIN"/>     <category android:name="android.intent.category.LAUNCHER"/> </intent-filter>        </activity>    </application></manifest>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/496963.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号