仿QQ登录界面

作为一个新手,当然从仿开始啦,虽然实现一个对大多数人来说很简单,但是对我刚刚的新手花了两三个小时j_0065.gif

下面是界面:

不说了,上代码更加重要

 布局如下:

  1 <?xml version="1.0" encoding="utf-8"?>
  2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3     android:layout_width="match_parent"
  4     android:layout_height="match_parent"
  5     android:orientation="vertical" 
  6     android:background="@drawable/default_bg">
  7  
  8 
  9     <LinearLayout 
 10         android:layout_width="wrap_content"
 11         android:layout_height="wrap_content"
 12         android:orientation="horizontal"
 13         android:layout_gravity="center_horizontal"
 14         android:layout_marginTop="100dp"
 15         android:layout_marginLeft="10dp"
 16         android:layout_marginRight="10dp">
 17         <ImageView 
 18             android:layout_height="50.0dip"
 19             android:layout_width="50.0dip"
 20             android:scaleType="centerCrop"
 21             android:adjustViewBounds="true"
 22             android:src="@drawable/h001"/>          
 23     </LinearLayout>
 24     <LinearLayout 
 25         android:layout_width="match_parent"
 26         android:layout_height="wrap_content"
 27         android:layout_marginLeft="35.dip"
 28         android:layout_marginRight="35.0dip"
 29         android:orientation="vertical">
 30         <LinearLayout 
 31             android:layout_width="match_parent"
 32             android:layout_height="wrap_content"
 33             android:orientation="horizontal">
 34             <ImageView 
 35                android:layout_height="30.0dip" 
 36                android:layout_width="30.0dip"
 37                android:layout_gravity="bottom"
 38                android:scaleType="centerCrop"
 39                android:adjustViewBounds="true"
 40                android:src="@drawable/head"
 41                 />
 42             <EditText 
 43             android:id="@+id/userNameText"
 44             android:layout_width="match_parent"
 45             android:layout_height="57.0dip"
 46             android:drawablePadding="15.0dip"
 47             android:layout_marginLeft="10dp"
 48             android:layout_marginRight="10dp"
 49             android:ems="10"
 50             android:hint="请输入账号"
 51             android:inputType="number"
 52             android:singleLine="true"
 53             android:textColorHint="#ffffff"
 54             android:textSize="16.0sp"/>
 55         </LinearLayout>
 56         
 57         <LinearLayout 
 58             android:layout_width="match_parent"
 59             android:layout_height="wrap_content"
 60             android:orientation="horizontal">    
 61             <ImageView 
 62                android:layout_height="30.0dip" 
 63                android:layout_width="30.0dip"
 64                android:layout_gravity="bottom"
 65                android:scaleType="centerCrop"
 66                android:adjustViewBounds="true"
 67                android:src="@drawable/lock"/>
 68             <EditText 
 69             android:id="@+id/passwordText"
 70             android:layout_width="match_parent"
 71             android:layout_height="57.0dip"
 72             android:drawablePadding="15.0dip"
 73             android:layout_marginLeft="10dp"
 74             android:layout_marginRight="10dp"
 75             android:ems="16"
 76             android:hint="请输入密码"
 77             android:inputType="textPassword"
 78             android:singleLine="true"
 79             android:textColorHint="#ffffff"
 80             android:textSize="16.0sp"/>
 81             </LinearLayout>
 82     </LinearLayout>
 83     
 84     <LinearLayout 
 85         android:layout_width="wrap_content"
 86         android:layout_height="57.0dp"
 87         android:layout_gravity="center"
 88         android:layout_marginTop="3.0dip"
 89         android:orientation="horizontal">
 90         <Button
 91             android:id="@+id/registerBtn"
 92             android:layout_height="42dip"
 93             android:layout_width="94dip"
 94             android:layout_gravity="center"
 95             android:layout_marginRight="10.0dp"
 96             android:text="注册"/>
 97          <Button 
 98             android:id="@+id/loginBtn"
 99             android:layout_height="42dip"
100             android:layout_width="94dip"
101             android:layout_gravity="center"
102             android:layout_marginLeft="15.0dp"
103             android:text="登录"/>
104     </LinearLayout>
105     
106 
107 </LinearLayout>

 

posted on 2015-11-01 16:15  I*M  阅读(585)  评论(0)    收藏  举报

导航