码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-06-09 16:35:09      阅读:416      评论:0      收藏:0      [点我收藏+]

标签:android   c   style   class   blog   code   

第五节(1):OA实战之登录界面


 一、登录界面布局

1.背景图片

2.文本框

3.checkbox

4.按钮

暂未实现点击切换图片效果    

bubuko.com,布布扣
<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>
bubuko.com,布布扣

 

bubuko.com,布布扣

二、使用SharedPreferences记住用户名密码
bubuko.com,布布扣
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);
        }
bubuko.com,布布扣

 

 
百度网盘视频下载地址:http://pan.baidu.com/s/1dDw2Rtf

android内部培训视频_第五节(1)_OA实战之登录界面,布布扣,bubuko.com

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

标签:android   c   style   class   blog   code   

原文地址:http://www.cnblogs.com/zhouyu629/p/3777659.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!