文档介绍:Android 开发我的新浪微博客户端-登录页面 UI 篇()
首先回顾一下功能流程当用户开启软件显示载入页面时程序首先去 sqlite 库查询是否已经
保存有用户的新浪微博的 UserID 号、Access Token、Access Secret 的记录如果没有
一条记录那么跳转到用户授权功能页面,这个已经由上面两篇文章实现了,如果有记录那么
页面跳转到用户登录页面,也就是本篇以及下篇要实现的功能,本篇讲 UI 的实现,本项目
支持多微博账号了,也就是用户可以设置多个微博账号,登录的时候选择其中的一个登录,
具体效果如上图,新建名 的 Activity 并且在 中
进行相应配置,这个页面就是我们要实现的用户登录页面。
看上面的效果,首先页面分 3 部分实现,背景部分、底部菜单部分、用户选择以及头像显
示部分,首先在 res/layout 的目录下新建名为 的 layout,然后根据页面显示
要求编写如下的布局控制:
代码
<?xml version="" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas./apk/res/android"
android:id="@+id/layout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="***@drawable/logo_s"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip">
</ImageView>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/iconBtn"
android:layout_width="90px"
android:layout_height="80px"
android:background="***@drawable/icon_selector"
android:layout_above="@+id/selectLayout"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dip">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_heig