第五节(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>

android内部培训视频_第五节(1)_OA实战之登录界面

二、使用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

更多相关文章

  1. Android的设置界面:SharedPreferences和PreferenceActivity的使用
  2. android 界面布局 很好的一篇总结
  3. Android应用界面开发_学习笔记_第二周
  4. android中视频播放的处理
  5. ViewPager实现QQ主界面,ViewFlipper实现某些新闻应用,自动播放,很
  6. 调用Android自带的联系人选择界面
  7. Android通过selector改变界面状态

随机推荐

  1. Android全局异常处理
  2. Android访问WEBAPI,传递json
  3. android md5
  4. Android Q 版本新的网络状况判断方式
  5. 解决org.apache.http.HttpResponse爆红
  6. 获取系统内存
  7. Android 手机状态
  8. Android 中的 requestWindowFeature
  9. Android HFP Profile 连接过程
  10. android Activity启动初始化与实例化Acti