在发行滚动型登录.. ParentBottom元素也弹出一个SoftKeyboard [英] Issue in Login ScrollView.. ParentBottom elements also pop up with SoftKeyboard

查看:212
本文介绍了在发行滚动型登录.. ParentBottom元素也弹出一个SoftKeyboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
     的xmlns:工具=htt​​p://schemas.android.com/tool​​s
  机器人:layout_width =match_parent
  机器人:layout_height =match_parent
  工具:上下文=>中登录。
  < ImageView的
    机器人:ID =@ + ID /标志
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =WRAP_CONTENT
    机器人:layout_alignParentRight =真
    机器人:layout_alignParentTop =真
    机器人:layout_margin =5DP
    机器人:contentDescription =@字符串/ APP_NAME
    机器人:SRC =@绘制/ logo_main/>    <的TextView
    机器人:ID =@ + ID / tv_textBottom
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =WRAP_CONTENT
    机器人:layout_alignParentBottom =真
    机器人:layout_centerInParent =真
    机器人:可点击=真
    机器人:文字=@字符串/ label_copyright
    机器人:文字颜色=@色/ text_grey/>     <滚动型
    机器人:ID =@ + ID / sv_Login
    机器人:layout_width =match_parent
    机器人:layout_height =WRAP_CONTENT
    机器人:layout_below =@ ID /标志
    机器人:layout_marginTop =10dp>    < RelativeLayout的
        机器人:ID =@ + ID / rl_Login
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT>        //这里面管理两种EDITTEXT的用户ID的密码
    < / RelativeLayout的>
< /滚动型>

此外在舱单登录,我设置

 的android:windowSoftInputMode =adjustResize

我的问题是,当softKeybord弹出..底部的文本(tv_textBottom)向上移动与keyboard..I尝试了很多方法,需要滚动视图并放置在父父底部的文本本身下来..
  在此先感谢...


解决方案

  //试试这个
** **的Andr​​oidManifest.xml
机器人:windowSoftInputMode =stateHidden< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    机器人:比重=中心
    机器人:方向=垂直
    机器人:填充=5DP
    工具:上下文=>中登录。    <的LinearLayout
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:重力=右>
        < ImageView的
            机器人:ID =@ + ID /标志
            机器人:layout_width =WRAP_CONTENT
            机器人:layout_height =WRAP_CONTENT
            机器人:layout_margin =5DP
            机器人:contentDescription =@字符串/ APP_NAME
            机器人:SRC =@绘制/ logo_main/>    < / LinearLayout中>    <滚动型
        机器人:ID =@ + ID / sv_Login
        机器人:layout_width =match_parent
        机器人:layout_height =0dp
        机器人:layout_weight =1
        机器人:layout_marginTop =10dp>        < RelativeLayout的
            机器人:ID =@ + ID / rl_Login
            机器人:layout_width =match_parent
            机器人:layout_height =WRAP_CONTENT>            //这里面管理两种EDITTEXT的用户ID的密码
        < / RelativeLayout的>
    < /滚动型>
    <的TextView
        机器人:ID =@ + ID / tv_textBottom
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:可点击=真
        机器人:文字=@字符串/ label_copyright
        机器人:文字颜色=@彩色/ text_grey
        机器人:layout_marginTop =5DP
        机器人:layout_marginBottom =5DP/>< / LinearLayout中>

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".Login" >


  <ImageView
    android:id="@+id/logo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_margin="5dp"
    android:contentDescription="@string/app_name"
    android:src="@drawable/logo_main" />

    <TextView
    android:id="@+id/tv_textBottom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerInParent="true"        
    android:clickable="true"
    android:text="@string/label_copyright"
    android:textColor="@color/text_grey" />

     <ScrollView
    android:id="@+id/sv_Login"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/logo"
    android:layout_marginTop="10dp" >

    <RelativeLayout
        android:id="@+id/rl_Login"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        //Inside this manage two editText for userId, Password


    </RelativeLayout>
</ScrollView>

Also In manifest for Login, I set

     android:windowSoftInputMode="adjustResize" 

My Issue is when softKeybord popup.. the bottom text(tv_textBottom) moves up with keyboard..I tried it many ways, need scrollview and placed the parent bottom text in parent down itself.. Thanks in Advance...

解决方案

//try this
**AndroidManifest.xml**
android:windowSoftInputMode="stateHidden"

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="5dp"
    tools:context=".Login" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="right">
        <ImageView
            android:id="@+id/logo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:contentDescription="@string/app_name"
            android:src="@drawable/logo_main" />

    </LinearLayout>

    <ScrollView
        android:id="@+id/sv_Login"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_marginTop="10dp" >

        <RelativeLayout
            android:id="@+id/rl_Login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            //Inside this manage two editText for userId, Password


        </RelativeLayout>
    </ScrollView>
    <TextView
        android:id="@+id/tv_textBottom"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:text="@string/label_copyright"
        android:textColor="@color/text_grey"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp"/>

</LinearLayout>

这篇关于在发行滚动型登录.. ParentBottom元素也弹出一个SoftKeyboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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