【3D技术宅公社】XR数字艺术论坛  XR技术讨论 XR互动电影 定格动画

 找回密码
 立即注册

QQ登录

只需一步,快速开始

调查问卷
论坛即将给大家带来全新的技术服务,面向三围图形学、游戏、动画的全新服务论坛升级为UTF8版本后,中文用户名和用户密码中有中文的都无法登陆,请发邮件到324007255(at)QQ.com联系手动修改密码

3D技术论坛将以计算机图形学为核心,面向教育 推出国内的三维教育引擎该项目在持续研发当中,感谢大家的关注。

查看: 1530|回复: 0

[转]高仿Android QQ2012登陆界面和注册界面

[复制链接]
发表于 2013-1-15 17:28:38 | 显示全部楼层 |阅读模式

最近工作比较轻松,项目不忙,所以闲着的时间去研究了自己比较感兴趣的UI界面,确实漂亮的UI能给用户带来良好的体验,在android应用中一直尤为重要,这次模仿的是QQ2012Android版的的最新登陆界面以及部分注册的功能,简洁漂亮的UI给人耳目一新的感觉,但看似简单的布局要真的自己做起来还是会遇到很多的困难,尤其是木有什么美工的基础,先上图片看下做完后的效果,有个别的地方还是与原版有出入的:

        

          

     



首先下载官方最新的QQ2012APK文件,然后将后缀名改为.rar打开后可以获得全部锁需要的图片资源,嘿嘿,好多.9的图片都不需要自己再做了~!,之后既要研究该如何去模仿这款应用的布局了

--------------------------------------------------华丽的分割线------------------------------------------------------------------

究竟怎样控制好各个控件之间的排布,如何确定各种布局的嵌套呢?既然是优秀的UI界面,我们来完全模仿,那就可以直接照搬QQ的设计排版,这里我用到了android中自带的

层级观察器hierarchyviewer工具来分析UI的布局,hierarchyviewer是非常之实用的工具,即可以用来优化自己的布局,也可以用来参考别人优秀的布局,在\android-sdk-windows\tools目录下双击即可以使用:



点击Load View Hierarchy 选项进入如下画面,可以分析其中的布局了:


分成四个区域,左边较大的工作区即是当前UI的整体布局,一层级的方式排列展示出来,右侧的分三块区域,上边是左侧的缩略图,中间是当前选中布局的属性介绍,可以点击查看具体的数值,很 方便,下边是点击当前布局的实际效果,通过这些就可以了解当前UI是怎样的布局,具体用到了哪些布局方式和控件,一目了然。

--------------------------------------------------华丽的分割线------------------------------------------------------------------

点击Inspect Scrrenshot,进入如下画面:


左侧区域是当前布局的树状结构,这样看起来布局更容易理解,右侧是当前页面的图像,可以通过鼠标移动十字交叉处选中当前元素,而具体的信息就会在中间显示出来。包括所选地方的颜色值,坐标信息,也可以通过放大来进一步进行细微的操作。通过这个工具,怎么样?是不是可以很轻松的把自己喜欢的UI模仿学习下来呢~!

--------------------------------------------------华丽的分割线------------------------------------------------------------------

以下是部分布局的代码,具体的java代码可以自行下载研究,我也写了比较幼稚的注释嘿嘿:

登陆界面的布局:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent"
  5.     android:background="@drawable/login_bg"
  6.     android:orientation="vertical" >

  7.     <ImageView
  8.         android:id="@+id/image_logo"
  9.         android:layout_width="wrap_content"
  10.         android:layout_height="wrap_content"
  11.         android:layout_marginLeft="42dp"
  12.         android:layout_marginRight="42dp"
  13.         android:layout_marginTop="40dp"
  14.         android:src="@drawable/login_pic2" />

  15.     <LinearLayout
  16.         android:id="@+id/linearLayout01"
  17.         android:layout_width="fill_parent"
  18.         android:layout_height="wrap_content"
  19.         android:layout_below="@id/image_logo"
  20.         android:layout_marginLeft="42dp"
  21.         android:layout_marginRight="42dp"
  22.         android:background="@drawable/login_input"
  23.         android:orientation="vertical" >

  24.         <LinearLayout
  25.             android:layout_width="fill_parent"
  26.             android:layout_height="wrap_content"
  27.             android:orientation="horizontal" >

  28.             <EditText
  29.                 android:id="@+id/et_qqNum"
  30.                 android:layout_width="220dp"
  31.                 android:layout_height="40dp"
  32.                 android:background="#00ffffff"
  33.                 android:hint="请输入QQ号码"
  34.                 android:inputType="number"
  35.                 android:paddingLeft="10dp" />

  36.             <Button
  37.                 android:id="@+id/btn_more_pop"
  38.                 android:layout_width="10dp"
  39.                 android:layout_height="8dp"
  40.                 android:layout_gravity="center"
  41.                 android:layout_marginRight="10dp"
  42.                 android:layout_weight="1"
  43.                 android:background="@drawable/login_input_arrow" />
  44.         </LinearLayout>

  45.         <View
  46.             android:layout_width="fill_parent"
  47.             android:layout_height="1dp"
  48.             android:layout_marginLeft="1dp"
  49.             android:layout_marginRight="1dp"
  50.             android:background="@drawable/divider_horizontal_line" />

  51.         <EditText
  52.             android:id="@+id/et_qqPwd"
  53.             android:layout_width="fill_parent"
  54.             android:layout_height="40dp"
  55.             android:background="#00ffffff"
  56.             android:hint="请输入密码"
  57.             android:inputType="textPassword"
  58.             android:paddingLeft="10dp" />
  59.     </LinearLayout>

  60.     <Button
  61.         android:id="@+id/btn_login"
  62.         android:layout_width="fill_parent"
  63.         android:layout_height="wrap_content"
  64.         android:layout_below="@id/linearLayout01"
  65.         android:layout_marginLeft="42dp"
  66.         android:layout_marginRight="42dp"
  67.         android:layout_marginTop="10dp"
  68.         android:background="@drawable/login_button_select"
  69.         android:text="登陆" />

  70.     <RelativeLayout
  71.         android:layout_width="fill_parent"
  72.         android:layout_height="wrap_content"
  73.         android:layout_below="@id/btn_login"
  74.         android:layout_marginLeft="42dp"
  75.         android:layout_marginRight="42dp" >

  76.         <CheckBox
  77.             android:layout_width="wrap_content"
  78.             android:layout_height="wrap_content"
  79.             android:background="@null"
  80.             android:button="@null"
  81.             android:checked="true"
  82.             android:drawableLeft="@drawable/checkbox_bg"
  83.             android:paddingTop="2dp"
  84.             android:text="记住密码"
  85.             android:textSize="12sp" />

  86.         <Button
  87.             android:id="@+id/btn_login_regist"
  88.             android:layout_width="wrap_content"
  89.             android:layout_height="wrap_content"
  90.             android:layout_alignParentRight="true"
  91.             android:background="@drawable/login_reg_button"
  92.             android:gravity="left|center"
  93.             android:paddingLeft="8dp"
  94.             android:paddingRight="25dp"
  95.             android:text="注册新账号"
  96.             android:textColor="#ffffffff"
  97.             android:textSize="12sp" />
  98.     </RelativeLayout>

  99.         
  100.         
  101.         
  102.         
  103.     <LinearLayout
  104.         android:layout_width="fill_parent"
  105.         android:layout_height="wrap_content"
  106.         android:layout_alignParentBottom="true"
  107.         android:background="@drawable/login_moremenu_back"
  108.         android:orientation="vertical" >

  109.         <RelativeLayout
  110.             android:clickable="true"
  111.             android:id="@+id/view_more"
  112.             android:layout_width="fill_parent"
  113.             android:layout_height="40dp" >

  114.             <TextView
  115.                 android:background="@null"
  116.                 android:id="@+id/tv_login_more"
  117.                 android:layout_width="wrap_content"
  118.                 android:layout_height="wrap_content"
  119.                 android:layout_centerInParent="true"
  120.                 android:gravity="center"
  121.                 android:text="更多登陆选项"
  122.                 android:textColor="#ffffffff" />

  123.             <ImageView
  124.                 android:id="@+id/img_more_up"
  125.                 android:layout_width="wrap_content"
  126.                 android:layout_height="wrap_content"
  127.                 android:layout_centerVertical="true"
  128.                 android:layout_toLeftOf="@id/tv_login_more"
  129.                 android:clickable="false"
  130.                 android:src="@drawable/login_more_up" />
  131.         </RelativeLayout>

  132.         <LinearLayout
  133.             android:id="@+id/menu_more"
  134.             android:layout_width="fill_parent"
  135.             android:layout_height="wrap_content"
  136.             android:orientation="vertical"
  137.             android:visibility="gone" >

  138.             <View
  139.                 android:layout_width="fill_parent"
  140.                 android:layout_height="1dp"
  141.                 android:background="#ffffffff" />

  142.             <View
  143.                 android:layout_width="fill_parent"
  144.                 android:layout_height="1dp"
  145.                 android:background="#ffffffff" />

  146.             <LinearLayout
  147.                 android:layout_width="fill_parent"
  148.                 android:layout_height="wrap_content"
  149.                 android:layout_marginLeft="35dp"
  150.                 android:layout_marginRight="35dp"
  151.                 android:layout_marginTop="17dp"
  152.                 android:orientation="horizontal" >

  153.                 <CheckBox
  154.                     android:layout_width="1dp"
  155.                     android:layout_height="wrap_content"
  156.                     android:layout_weight="2"
  157.                     android:background="@null"
  158.                     android:button="@null"
  159.                     android:drawableLeft="@drawable/checkbox_bg"
  160.                     android:drawablePadding="4dp"
  161.                     android:text="隐身登陆"
  162.                     android:textSize="12sp" />

  163.                 <CheckBox
  164.                     android:layout_width="1dp"
  165.                     android:layout_height="wrap_content"
  166.                     android:layout_weight="1"
  167.                     android:background="@null"
  168.                     android:button="@null"
  169.                     android:drawableLeft="@drawable/checkbox_bg"
  170.                     android:drawablePadding="4dp"
  171.                     android:text="静音登陆"
  172.                     android:textSize="12sp" />
  173.             </LinearLayout>

  174.             <LinearLayout
  175.                 android:layout_width="fill_parent"
  176.                 android:layout_height="wrap_content"
  177.                 android:layout_marginBottom="17dp"
  178.                 android:layout_marginLeft="35dp"
  179.                 android:layout_marginRight="35dp"
  180.                 android:layout_marginTop="17dp"
  181.                 android:orientation="horizontal" >

  182.                 <CheckBox
  183.                     android:layout_width="1dp"
  184.                     android:layout_height="wrap_content"
  185.                     android:layout_weight="2"
  186.                     android:background="@null"
  187.                     android:button="@null"
  188.                     android:drawableLeft="@drawable/checkbox_bg"
  189.                     android:drawablePadding="4dp"
  190.                     android:text="允许手机/电脑同时在线"
  191.                     android:textSize="12sp" />

  192.                 <CheckBox
  193.                     android:layout_width="1dp"
  194.                     android:layout_height="wrap_content"
  195.                     android:layout_weight="1"
  196.                     android:background="@null"
  197.                     android:button="@null"
  198.                     android:drawableLeft="@drawable/checkbox_bg"
  199.                     android:drawablePadding="4dp"
  200.                     android:text="接收群消息"
  201.                     android:textSize="12sp" />
  202.             </LinearLayout>
  203.         </LinearLayout>
  204.     </LinearLayout>

  205. </RelativeLayout>
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|3D数字艺术论坛 ( 沪ICP备14023054号 )

GMT+8, 2025-5-14 18:47

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表