QQ登陆界面
2013-01-15 10:34
148 查看
终于完成QQ登陆界面布局,哎,这是Android 工作的第一个工作任务。虽然做了两三天,但很欣慰,最终能够完成。
下面我把自己感觉最难的布局贴出来,即QQ账号的布局,困扰我好久,因为之前没练过。
QQ账号(即上面其中一个布局)布局代码:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/accout_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="55dp"
android:layout_marginRight="50dp"
android:background="@drawable/qq_edit_login"
android:hint="请输入账号"
android:numeric="integer"
android:paddingLeft="50dp"
android:paddingTop="10sp"
android:singleLine="true"
android:maxLength="12"
android:textSize="20dp" />
<TextView
android:id="@+id/count_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:paddingTop="10dp"
android:layout_alignTop="@id/accout_edit"
android:layout_alignBottom="@id/accout_edit"
android:text="账号"
android:textSize="20dp" />
<ImageButton
android:id="@+id/imagebuttom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/count_txt"
android:layout_alignTop="@id/accout_edit"
android:layout_alignBottom="@id/accout_edit"
android:layout_marginLeft="135dp"
android:background="@drawable/account_button_prsess" />
<!-- 注意定位方式,在ImageButton 中现在对齐方式中在TextView的右边,在能在layout_marginLeft="135dp"体现出,在
距离左边135dp的距离。还有注意方向 -->
</RelativeLayout>
资源文件:
account_button_press.xml:
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/button2_down" />
<!-- press -->
<item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/button2_over" />
<!--focused -->
<item android:state_enabled="true" android:drawable="@drawable/button2" />
<!-- defauld -->
</selector>
qq_edit_login.xml:
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/input" />
<item android:state_pressed="true" android:drawable="@drawable/input" />
<item android:state_focused="true" android:drawable="@drawable/input_over" />
</selector>
图片:
希望大家能够在Android方面相互学习,相互探讨!
日起:2013.115
下面我把自己感觉最难的布局贴出来,即QQ账号的布局,困扰我好久,因为之前没练过。
QQ账号(即上面其中一个布局)布局代码:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/accout_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="55dp"
android:layout_marginRight="50dp"
android:background="@drawable/qq_edit_login"
android:hint="请输入账号"
android:numeric="integer"
android:paddingLeft="50dp"
android:paddingTop="10sp"
android:singleLine="true"
android:maxLength="12"
android:textSize="20dp" />
<TextView
android:id="@+id/count_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:paddingTop="10dp"
android:layout_alignTop="@id/accout_edit"
android:layout_alignBottom="@id/accout_edit"
android:text="账号"
android:textSize="20dp" />
<ImageButton
android:id="@+id/imagebuttom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/count_txt"
android:layout_alignTop="@id/accout_edit"
android:layout_alignBottom="@id/accout_edit"
android:layout_marginLeft="135dp"
android:background="@drawable/account_button_prsess" />
<!-- 注意定位方式,在ImageButton 中现在对齐方式中在TextView的右边,在能在layout_marginLeft="135dp"体现出,在
距离左边135dp的距离。还有注意方向 -->
</RelativeLayout>
资源文件:
account_button_press.xml:
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/button2_down" />
<!-- press -->
<item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/button2_over" />
<!--focused -->
<item android:state_enabled="true" android:drawable="@drawable/button2" />
<!-- defauld -->
</selector>
qq_edit_login.xml:
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/input" />
<item android:state_pressed="true" android:drawable="@drawable/input" />
<item android:state_focused="true" android:drawable="@drawable/input_over" />
</selector>
图片:
希望大家能够在Android方面相互学习,相互探讨!
日起:2013.115
相关文章推荐
- 山寨qq登陆界面
- Qt 之 模仿 QQ登陆界面——旋转窗口篇
- Qt 之 模仿 QQ登陆界面——样式篇
- ios swift模仿qq登陆界面,xml布局
- Android仿QQ微信开场导航以及登陆界面
- 使用层级观察器hierarchyviewer综合各种布局实现Android QQ2012登陆界面和注册界面
- 高仿Android QQ2012登陆界面和注册界面
- Android仿QQ微信开场导航以及登陆界面
- android布局基础及范例(一):QQ登陆界面设计
- Qt 之 模仿 QQ登陆界面——功能篇(一)
- 高仿Android QQ2012登陆界面和注册界面
- 仿qq登陆界面
- 数据存储--SharedPreferences--仿QQ登陆界面记住密码效果
- android实现仿QQ登陆界面的多账号保存
- Android仿QQ微信开场导航以及登陆界面
- 一个简单的安卓仿qq登陆界面
- Android开发系列 QQ登陆界面——Android控件使用实例 - Carlos.V
- Java编写山寨QQ中遇到的各种问题---登陆界面
- 使用层级观察器hierarchyviewer综合各种布局实现Android QQ2012登陆界面和注册界面
- Android学习笔记(一)——仿qq聊天的welcome界面登陆的实现