Android手机QQ界面设计

Android手机开发布局是存放一个或多个子对象及某种行为的容器,行为描述了如何将这些子对象放置在屏幕上其父对象的矩形区域中。下面列出了Android中最常用的几种布局。

FrameLayout(框架布局):从屏幕的左上角开始显示子对象,主要用于选项卡视图和图像切换器。

LinearLayout(线性布局):以单列或单行的形式显示子对象,这是最常用的布局方式。

RelativeLayout(相对布局):以相对于其他子对象或父对象的位置显示子对象,这种布局通常用于表单中。

TableLayout(表格布局):以多行和多列的方式显示子对象,类似于HTML表格。

下面是我实现的一个手机QQ界面布局:(请查看文章下方的附件图片)

<?xml version="1.0" encoding="UTF-8"?><LinearLayout android:orientation="vertical" android:id="@+id/loginRoot"android:layout_width="fill_parent" android:layout_height="fill_parent"xmlns:android="http://schemas.android.com/apk/res/android"><LinearLayout android:orientation="vertical" android:id="@+id/LinearLayout01"android:layout_width="fill_parent" android:layout_height="wrap_content"android:layout_weight="1.0"android:background="@drawable/default_bg"><RelativeLayout android:id="@+id/RelativeLayout02"android:background="@drawable/login_back" android:paddingTop="21.0px"android:paddingBottom="10.0px" android:layout_width="fill_parent"android:layout_height="wrap_content" android:layout_marginLeft="15.0px"android:layout_marginTop="62.0px" android:layout_marginRight="15.0px"><ImageView android:id="@+id/faceImg" android:background="@drawable/login_head"android:layout_width="wrap_content" android:layout_height="wrap_content" /><EditText android:id="@+id/login_edit_account"android:background="@drawable/qq_edit_login" android:paddingLeft="45.0sp"android:saveEnabled="true" android:layout_width="fill_parent"android:layout_height="wrap_content" android:layout_marginLeft="5.0dip"android:layout_marginTop="5.0dip" android:layout_marginRight="5.0dip"android:layout_marginBottom="5.0px" android:hint="@string/strInputAccHint"android:maxLength="10" android:layout_toRightOf="@+id/faceImg"android:layout_alignParentTop="true" android:inputType="number" /><TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f"android:gravity="center_vertical" android:id="@+id/TextView01"android:paddingLeft="7.0sp" android:layout_width="wrap_content"android:layout_height="wrap_content" android:layout_marginRight="15.0sp"android:text="@string/strAccInputLabel" android:layout_alignLeft="@+id/login_edit_account"android:layout_alignTop="@+id/login_edit_account"android:layout_alignBottom="@+id/login_edit_account" /><ImageButton android:id="@+id/ImageButton02"android:background="@drawable/more_select" android:layout_width="wrap_content"android:layout_height="wrap_content" android:layout_marginRight="1.0dip"android:layout_alignTop="@+id/login_edit_account"android:layout_alignRight="@+id/login_edit_account"android:layout_alignBottom="@+id/login_edit_account" /><EditText android:id="@+id/login_edit_pwd"android:background="@drawable/qq_edit_login" android:paddingLeft="45.0sp"android:saveEnabled="true" android:layout_width="wrap_content"android:layout_height="wrap_content" android:layout_marginRight="1.0dip"android:maxLength="16" android:layout_below="@+id/login_edit_account"android:layout_alignLeft="@+id/login_edit_account"android:layout_alignRight="@+id/login_edit_account"android:inputType="textPassword" /><TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f"android:gravity="center_vertical" android:id="@+id/TextView02"android:paddingLeft="7.0sp" android:layout_width="wrap_content"android:layout_height="wrap_content" android:text="@string/strPswInputLabel"android:layout_alignTop="@+id/login_edit_pwd"android:layout_alignRight="@+id/TextView01"android:layout_alignBottom="@+id/login_edit_pwd" /><CheckBox android:textSize="16.0sp" android:textColor="#ff222222"android:id="@+id/login_cb_savepwd" android:paddingLeft="25.0px"android:layout_width="wrap_content" android:layout_height="wrap_content"android:checked="true" android:button="@drawable/qq_btn_check"android:text="@string/opt_remember" android:layout_alignBaseline="@+id/login_btn_login" /><Button android:id="@+id/login_btn_login" android:layout_width="130.0px"android:layout_height="42.0px" android:layout_marginTop="7.0px"android:layout_marginRight="12.0dip" android:text="@string/login"android:layout_below="@+id/TextView02"android:layout_alignParentRight="true" /></RelativeLayout><TableLayout android:id="@+id/TableLayout01"android:layout_width="fill_parent" android:layout_height="wrap_content"android:layout_marginLeft="20.0px" android:layout_marginRight="20.0px"android:stretchColumns="1"><TableRow><CheckBox android:textColor="#7fffffff" android:id="@+id/login_cb_visible"android:layout_width="wrap_content" android:layout_height="wrap_content"android:text="@string/opt_hideLogin" style="@style/MyCheckBox" /><CheckBox android:textColor="#7fffffff"android:layout_gravity="right" android:id="@+id/login_cb_openvibra"android:layout_width="wrap_content" android:layout_height="wrap_content"android:text="@string/opt_openVibra" style="@style/MyCheckBox" /></TableRow><TableRow><CheckBox android:textColor="#7fffffff" android:id="@+id/login_cb_receivegroupmsg"android:layout_width="wrap_content" android:layout_height="wrap_content"android:text="@string/opt_acceptGroupMsg" style="@style/MyCheckBox" /><CheckBox android:textColor="#7fffffff"android:layout_gravity="right" android:id="@+id/login_cb_quite"android:layout_width="wrap_content" android:layout_height="wrap_content"android:text="@string/opt_silent" style="@style/MyCheckBox" /></TableRow></TableLayout></LinearLayout><RelativeLayout android:id="@+id/RelativeLayout01"android:background="@drawable/bottom" android:layout_width="fill_parent"android:layout_height="44.0dip"><ImageButton android:id="@+id/login_option"android:background="@drawable/option" android:clickable="true"android:layout_width="wrap_content" android:layout_height="wrap_content"android:layout_marginLeft="13.0dip" android:layout_marginTop="2.0dip"android:layout_centerVertical="true" /></RelativeLayout></LinearLayout>

package com.android.test.login;import android.app.Activity;import android.os.Bundle;public class Date extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.loginpage);    }}

<!--EndFragment-->

更多相关文章

  1. 类和 Json对象
  2. Android入门篇五:使用全局变量在Activity之间传递数据
  3. Android(安卓)内存浅析
  4. 深入剖析Android消息机制
  5. 【Android面试知识点系列】Handler相关
  6. Android内存管理
  7. Android在未来的发展
  8. 初学Android,跨进程调用Service(六十)
  9. 深入Android(安卓)【一】 —— 序及开篇

随机推荐

  1. sql语句优化之SQL Server(详细整理)
  2. 查询Sqlserver数据库死锁的一个存储过程
  3. SQL语句的并集UNION 交集JOIN(内连接,外连
  4. SQL Server中的SQL语句优化与效率问题
  5. sql 聚集索引和非聚集索引(详细整理)
  6. SQL SERVER数据库重建索引的方法
  7. SQL Server 压缩日志与减少SQL Server 文
  8. 针对Sqlserver大数据量插入速度慢或丢失
  9. ms sql server中实现的unix时间戳函数(含
  10. sql 判断函数、存储过程是否存在的代码整