android内部培训视频_第五节(1)_OA实战之登录界面
16lz
2022-05-18
第五节(1):OA实战之登录界面
一、登录界面布局
1.背景图片
2.文本框
3.checkbox
4.按钮
暂未实现点击切换图片效果
<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" android:paddingLeft="20dp" android:paddingRight="20dp" android:gravity="center" android:background="@drawable/login_bj" tools:context=".MainActivity" > <LinearLayout android:id="@+id/ll01" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <EditText android:id="@+id/txtUserName" android:layout_width="match_parent" android:layout_height="70dp" android:background="@drawable/input" android:layout_marginBottom="20dp" android:hint="@string/txtusername_tips" android:inputType="none" /> <EditText android:id="@+id/txtPassword" android:layout_width="match_parent" android:layout_height="70dp" android:background="@drawable/input" android:layout_marginBottom="20dp" android:hint="@string/txtpassword_tips" android:inputType="textPassword" /> <LinearLayout android:id="@+id/ll02" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:layout_marginBottom="20dp" > <CheckBox android:id="@+id/cbPass" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/cbpass_txt" /> <CheckBox android:id="@+id/cbAuto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/cbauto_txt" /> </LinearLayout> <Button android:id="@+id/btnLogin" android:layout_width="match_parent" android:layout_height="70dp" android:background="@drawable/login_btn" android:text="@string/btnlogin_txt" android:textSize="25sp" android:textColor="#FFF" /> </LinearLayout></RelativeLayout>二、使用SharedPreferences记住用户名密码
SharedPreferences sharedPreferences = getSharedPreferences( "userinfo", MODE_PRIVATE); String userName = sharedPreferences.getString("userName", ""); String userPass = sharedPreferences.getString("passWord", ""); if(!"".equals(userName) && !"".equals(userPass)){ txtUserName.setText(userName); txtPassword.setText(userPass); }百度网盘视频下载地址: http://pan.baidu.com/s/1dDw2Rtf
更多相关文章
- android 界面布局 很好的一篇总结
- Android应用界面开发_学习笔记_第二周
- 浅谈android的selector,背景选择器
- android button按键得到焦点和点击后改变背景图片
- android背景选择器selector用法汇总
- android 界面布局 很好的一篇总结 【转】
- ViewPager实现QQ主界面,ViewFlipper实现某些新闻应用,自动播放,很
- 调用Android自带的联系人选择界面
- android 界面布局 很好的一篇总结 【转】