使用输入法时使界面自动上移的方法
来源:互联网 发布:centos搭建代理服务器 编辑:程序博客网 时间:2024/06/05 15:51
转载地址:
http://www.cnblogs.com/_ymw/p/4234185.html
先贴上效果图:
1 <?xml version="1.0" encoding="utf-8"?> 2 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="match_parent" 5 android:background="@drawable/main_bg" 6 android:fillViewport="true" > 7 8 <!-- 设置fillViewport属性表示充满整个ScrollView --> 9 10 <LinearLayout 11 android:layout_width="fill_parent" 12 android:layout_height="wrap_content" 13 android:orientation="vertical" > 14 15 <LinearLayout 16 android:id="@+id/logo" 17 android:layout_width="fill_parent" 18 android:layout_height="wrap_content" 19 android:layout_marginTop="20dip" 20 android:layout_weight="1" 21 android:gravity="bottom|center_horizontal" 22 android:orientation="vertical" > 23 24 <ImageView 25 android:id="@+id/imageView1" 26 android:layout_width="wrap_content" 27 android:layout_height="wrap_content" /> 28 29 <ImageView 30 android:id="@+id/serviceimg" 31 android:layout_width="wrap_content" 32 android:layout_height="wrap_content" /> 33 </LinearLayout> 34 35 <LinearLayout 36 android:id="@+id/login" 37 android:layout_width="fill_parent" 38 android:layout_height="wrap_content" 39 android:layout_weight="1" 40 android:gravity="top|center_horizontal" 41 android:orientation="vertical" 42 android:visibility="visible" > 43 44 <LinearLayout 45 android:layout_width="fill_parent" 46 android:layout_height="wrap_content" 47 android:layout_marginLeft="60dip" 48 android:layout_marginRight="60dip" 49 android:orientation="vertical" > 50 51 <LinearLayout 52 android:layout_width="fill_parent" 53 android:layout_height="wrap_content" 54 android:gravity="center" 55 android:orientation="horizontal" > 56 57 <RelativeLayout 58 android:layout_width="wrap_content" 59 android:layout_height="wrap_content" 60 android:layout_weight="1" > 61 62 <EditText 63 android:id="@+id/userid" 64 android:layout_width="fill_parent" 65 android:layout_height="wrap_content" 66 android:layout_marginTop="5.0dip" 67 android:maxLength="16" 68 android:maxLines="1" 69 android:paddingBottom="6.0dip" 70 android:paddingLeft="80.0dip" 71 android:paddingTop="6.0dip" 72 android:textColor="#ff333333" 73 android:textSize="20sp" /> 74 75 <TextView 76 android:id="@+id/textView2" 77 android:layout_width="wrap_content" 78 android:layout_height="wrap_content" 79 android:layout_alignBaseline="@id/userid" 80 android:layout_marginTop="15.0dip" 81 android:paddingLeft="10.0dip" 82 android:text="帐号:" 83 android:textColor="#ff00303e" 84 android:textSize="20sp" /> 85 </RelativeLayout> 86 87 <Button 88 android:id="@+id/history" 89 android:layout_width="wrap_content" 90 android:layout_height="wrap_content" 91 android:layout_marginLeft="5dip" 92 android:text="..." /> 93 </LinearLayout> 94 95 <RelativeLayout 96 android:layout_width="fill_parent" 97 android:layout_height="wrap_content" 98 android:layout_marginTop="10dip" > 99 100 <EditText101 android:id="@+id/password"102 android:layout_width="fill_parent"103 android:layout_height="wrap_content"104 android:layout_marginTop="5.0dip"105 android:inputType="textPassword"106 android:maxLength="16"107 android:maxLines="1"108 android:paddingBottom="6.0dip"109 android:paddingLeft="80.0dip"110 android:paddingTop="6.0dip"111 android:textColor="#ff333333"112 android:textSize="20sp" />113 114 <TextView115 android:layout_width="wrap_content"116 android:layout_height="wrap_content"117 android:layout_alignBaseline="@id/password"118 android:layout_marginTop="15.0dip"119 android:paddingLeft="10.0dip"120 android:text="密码:"121 android:textColor="#ff00303e"122 android:textSize="20sp" />123 </RelativeLayout>124 125 <LinearLayout126 android:layout_width="fill_parent"127 android:layout_height="wrap_content"128 android:layout_marginTop="15dp"129 android:gravity="center"130 android:orientation="horizontal" >131 132 <Button133 android:id="@+id/setbt"134 android:layout_width="wrap_content"135 android:layout_height="wrap_content"136 android:layout_weight="1"137 android:text="设置"138 android:textColor="#FFFFFFFF"139 android:textSize="20sp" />140 141 <Button142 android:id="@+id/loginbt"143 android:layout_width="wrap_content"144 android:layout_height="wrap_content"145 android:layout_marginLeft="20dip"146 android:layout_weight="1"147 android:text="登录"148 android:textColor="#FFFFFFFF"149 android:textSize="20sp" />150 </LinearLayout>151 </LinearLayout>152 </LinearLayout>153 154 <LinearLayout155 android:id="@+id/linearLayout3"156 android:layout_width="fill_parent"157 android:layout_height="wrap_content"158 android:layout_marginTop="20dp"159 android:layout_weight="1"160 android:alwaysDrawnWithCache="true"161 android:gravity="bottom|center_horizontal"162 android:orientation="vertical" >163 164 <TextView165 android:id="@+id/info"166 android:layout_width="fill_parent"167 android:layout_height="wrap_content"168 android:layout_marginBottom="15dp"169 android:autoLink="web"170 171 android:gravity="center_horizontal"172 android:text="http://www.cnblogs.com/_ymw/"173 android:textColor="#FFFFFF"174 android:textSize="20sp" />175 </LinearLayout>176 </LinearLayout>177 178 </ScrollView>
0 0
- 使用输入法时使界面自动上移的方法
- 当输入法调出时,如何让界面自动上移,使输入法不会遮挡到主界面 android:windowSoftInputMode属性使用
- Android 登录界面调用输入法时让界面自动上移
- Android界面技巧:当输入法调出时,如何让界面自动上移,使输入法不会遮挡到主界面(Activity)
- Android 输入法弹出界面上移的问题
- 当键盘挡住输入框时候,可以使的界面自动上移
- 输入法弹出后整个登录界面上移不用ScrollView实现方法
- 解决聊天界面输入法弹出Recyclerview不上移
- 安卓使用EditText进入一个新页面时自动获取焦点弹出输入法界面解决办法
- 设置进入存在EditText的界面时,输入法不会自动弹出
- 打开有EditText的界面不要自动弹出输入法
- Android实现弹出输入法时,顶部固定,中间部分上移的效果
- Android实现弹出输入法时,顶部固定,中间部分上移的效果
- Android实现弹出输入法时,顶部固定,中间部分上移的效果
- work_weipa_打字时界面上移问题
- Android 防止EditText软键盘使键盘上移的方法
- 关于Android弹出输入法后页面需要上移的问题。
- android中弹出输入法,内容上移的问题
- 点击某个图片放大到全屏的动画效果
- hdu3480(斜率dp)
- linux kernel的中断子系统之(四):High level irq event handler
- 什么是跨域?怎么解决跨域问题?
- linux下创建定时任务 执行删除某文件夹下所有
- 使用输入法时使界面自动上移的方法
- 简单的TCP通讯
- Linux 下摄像头驱动支持情况(arm linux 同样适用)
- mysql_use_result和mysql_store_result
- Java动态代理与Cglib库
- 一个坑爹的问题,js注释掉夹杂的el表达式页面不显示(代码颜色坑了我)
- ubuntu15.10 手动安装最新Nvidia显卡驱动
- Android学习笔记五之Service
- 二分查找(递归与非递归实现)