键盘没有滚动以上的EditText [英] Keyboard is not scrolling EditText above

查看:125
本文介绍了键盘没有滚动以上的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这code。然而,当我过上的EditText点击打开键盘,观点是不完全的。为什么视图不会一路上涨,的EditText背后却隐藏着键盘

 <?XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    机器人:方向=垂直
    机器人:重力=CENTER_HORIZONTAL
    机器人:背景=@绘制/ main_bg
    机器人:ID =@ + ID / mainLayout
    机器人:focusableInTouchMode =真
    >       < RelativeLayout的
        机器人:layout_width =match_parent
        机器人:layout_height =40dp
        机器人:方向=横向
        机器人:ID =@ + ID /顶栏
        机器人:背景=@绘制/ top_bar_bg
     >        <的LinearLayout
                机器人:layout_height =WRAP_CONTENT
                机器人:layout_width =WRAP_CONTENT
                机器人:方向=横向
                机器人:重力=CENTER_HORIZONTAL |底
                机器人:layout_centerInParent =真
            >                 < ImageView的
                     机器人:ID =@ + ID / loadingAnimationImg
                     机器人:layout_height =35dp
                     机器人:layout_width =35dp
                     机器人:adjustViewBounds =真
                     机器人:contentDescription =@空
                     机器人:背景=@绘制/ img05/>                 < ImageView的
                     机器人:layout_marginBottom =5DP
                     机器人:layout_height =WRAP_CONTENT
                     机器人:layout_width =120dp
                     机器人:adjustViewBounds =真
                     机器人:contentDescription =@空
                     机器人:SRC =@绘制/ simple_logo/>         < / LinearLayout中>
    < / RelativeLayout的>    < GridView控件
            机器人:layout_marginTop =5DP
            机器人:layout_width =match_parent
            机器人:layout_height =300dp
            机器人:ID =@ + ID / GridView控件
            机器人:为numColumns =5
            机器人:verticalSpacing =5DP/>    <的TextView
        机器人:layout_marginTop =5DP
        机器人:layout_marginLeft =10dp
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:TEXTSIZE =12SP
        机器人:文字颜色=@机器人:彩色/白
        机器人:文字=@字符串/ hashtagText
        />
    < com.trib.devicebee.custom.FlowLayout
        机器人:ID =@ + ID /的FlowLayout
        机器人:layout_margin =10dp
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        />    <的EditText
        机器人:layout_margin =10dp
        机器人:ID =@ + ID / hashTagsText
        机器人:提示=
        机器人:inputType下=为TextFilter
        机器人:单线=真
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:TEXTSIZE =12SP
        />    <按钮
        机器人:ID =@ + ID / goAheadBtn
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:背景=@绘制/ go_ahead_btn
        机器人:layout_margin =10dp
         />< / LinearLayout中>


解决方案

尝试玩的android:在AndroidManifest.xml windowSoftInputMode 属性 - adjustPan可能是的回答。

 <活动
    机器人:名字=MyActivity
    机器人:windowSoftInputMode =adjustPan
    机器人:configChanges =方向| keyboardHidden |屏幕尺寸
    >
< /活性GT;

I am using this code. However when ever i click on EditText to open the keyboard, the view is not totally up. Why the view is not going up all the way, EditText is hidden behind Keyboard

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:background="@drawable/main_bg" 
    android:id="@+id/mainLayout"
    android:focusableInTouchMode="true"
    >

       <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:orientation="horizontal"
        android:id="@+id/topBar"
        android:background="@drawable/top_bar_bg"
     >

        <LinearLayout 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_horizontal|bottom"
                android:layout_centerInParent="true"
            >

                 <ImageView 
                     android:id="@+id/loadingAnimationImg"
                     android:layout_height="35dp"
                     android:layout_width="35dp"
                     android:adjustViewBounds="true"
                     android:contentDescription="@null"
                     android:background="@drawable/img05"/>

                 <ImageView 
                     android:layout_marginBottom="5dp"
                     android:layout_height="wrap_content"
                     android:layout_width="120dp"
                     android:adjustViewBounds="true"
                     android:contentDescription="@null"
                     android:src="@drawable/simple_logo"/>

         </LinearLayout>
    </RelativeLayout>

    <GridView
            android:layout_marginTop="5dp"
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:id="@+id/gridView"
            android:numColumns="5"
            android:verticalSpacing="5dp" />

    <TextView 
        android:layout_marginTop="5dp"
        android:layout_marginLeft="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="12sp"
        android:textColor="@android:color/white"
        android:text="@string/hashtagText"
        />


    <com.trib.devicebee.custom.FlowLayout 
        android:id="@+id/flowLayout"
        android:layout_margin="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

    <EditText 
        android:layout_margin="10dp"
        android:id="@+id/hashTagsText"
        android:hint=""
        android:inputType="textFilter" 
        android:singleLine="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="12sp"
        />

    <Button
        android:id="@+id/goAheadBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/go_ahead_btn"
        android:layout_margin="10dp"
         />

</LinearLayout>

解决方案

Try to play with android:windowSoftInputMode attribute in AndroidManifest.xml - "adjustPan" could be the answer.

<activity
    android:name="MyActivity"
    android:windowSoftInputMode="adjustPan"
    android:configChanges="orientation|keyboardHidden|screenSize"
    >
</activity>

这篇关于键盘没有滚动以上的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆