android - 弹出软件盘为什么会把EditText遮住一半呀,怎么解决
阿神
阿神 2017-04-17 17:07:34
[Android讨论组]
<ScrollView
    android:layout_below="@id/actionBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/ttk_bg"
        android:orientation="vertical">

        <TextView
            android:id="@+id/tv_qq"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:gravity="center_vertical"
            android:paddingLeft="10dp"
            android:text="@string/TTKVOD_Android_QQ_groupNum"
            android:textColor="@color/text_deep_content"
            android:textSize="@dimen/text_size_14" />

        <!--反馈问题类型-->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/white"
            android:orientation="vertical"
            android:padding="10dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="遇到的问题类型:(必填)"
                android:textColor="@color/text_shallow_content"
                android:textSize="@dimen/text_size_14" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp">

                <Space
                    android:id="@+id/center"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_centerHorizontal="true" />

                <TextView
                    android:id="@+id/tv_play_slow"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="10dp"
                    android:layout_toLeftOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="播放太卡" />

                <TextView
                    android:id="@+id/tv_play_fail"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentRight="true"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="播放失败/黑屏" />

                <TextView
                    android:id="@+id/tv_download_error"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@id/tv_play_slow"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_toLeftOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="下载有问题" />

                <TextView
                    android:id="@+id/tv_loading_error"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentRight="true"
                    android:layout_below="@id/tv_play_fail"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_toRightOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="页面加载失败" />

                <TextView
                    android:id="@+id/tv_app_crash"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@id/tv_download_error"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_toLeftOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="程序闪退" />

                <TextView
                    android:id="@+id/tv_others"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_alignParentRight="true"
                    android:layout_below="@id/tv_loading_error"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_toRightOf="@id/center"
                    android:background="@drawable/feedback_item_bg_selector"
                    android:gravity="center"
                    android:text="其他问题" />
            </RelativeLayout>
        </LinearLayout>

        <EditText
            android:id="@+id/et_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp"
            android:background="@color/white"
            android:gravity="top|left"
            android:hint="您反馈问题的描述越详细对我们越有帮助哦!"
            android:minHeight="100dp"
            android:padding="10dp"
            android:textColor="@color/text_deep_content"
            android:textColorHint="@color/text_shallow_content"
            android:textSize="@dimen/text_size_14" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp"
            android:background="@color/white">

            <View
                android:id="@+id/pider"
                android:layout_width="1dp"
                android:layout_height="20dp"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:background="@color/pider_color" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_toLeftOf="@id/pider"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="10dp"
                    android:text="手机"
                    android:layout_gravity="center_vertical"
                    android:textColor="@color/text_shallow_content"
                    android:textSize="@dimen/text_size_14" />

                <EditText
                    android:id="@+id/et_phone_num"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:background="@color/white"
                    android:maxLines="1"
                    android:paddingRight="10dp"
                    android:textColor="@color/text_deep_content"
                    android:textSize="@dimen/text_size_14" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_toRightOf="@id/pider"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="10dp"
                    android:text="系统"
                    android:layout_gravity="center_vertical"
                    android:textColor="@color/text_shallow_content"
                    android:textSize="@dimen/text_size_14" />

                <EditText
                    android:id="@+id/et_system"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:background="@color/white"
                    android:maxLines="1"
                    android:paddingRight="10dp"
                    android:textColor="@color/text_deep_content"
                    android:textSize="@dimen/text_size_14" />

            </LinearLayout>
        </RelativeLayout>

        <EditText
            android:id="@+id/et_others_num"
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginTop="15dp"
            android:background="@color/white"
            android:hint="QQ、邮箱"
            android:maxLines="1"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:textColor="@color/text_deep_content"
            android:textColorHint="@color/text_shallow_content"
            android:textSize="@dimen/text_size_14" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:text="您的联系方式有助于我们沟通和解决,仅工作人员可见"
            android:textColor="@color/text_shallow_content"
            android:layout_marginBottom="15dp"
            android:textSize="@dimen/text_size_12" />

    </LinearLayout>
</ScrollView>


整个布局被ScrollView包裹,弹出软键盘EditText会被遮住一些,这是怎么回事啊
阿神
阿神

闭关修行中......

全部回复(3)
巴扎黑

我给EditText的设置背景就出这个问题了,如果不设置背景就正常了

有人能看看这是什么问题吗

问题已经解决了,很让人匪夷所思啊,我把EditText的高度去掉,改成上下各Padding 15 就正常了,还是希望路过的高手能指点一下,能帮我分析一下什么原因,谢谢了

黄舟

手机恢复,内容不全。。。弹出软键盘的布局模式可以在清单文件中配置,默认是盖上去,可以调整为弹上去的。。

PHP中文网

你没有设置一个属性 ajust_span

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号