以前做一个个人资料页面不是很美观,现在又抽时间重新整理一下,看着还凑合,谁有更好的,请拿出来分享下,先看下效果图:
1.XML布局代码
Activity代码就不贴出来了,主要是XML布局文件的代码,本文附源代码下载:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#ffffff"
- android:orientation="vertical" >
- <FrameLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/user_info_bg">
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginTop="30dip">
- <FrameLayout
- android:layout_width="60.0dip"
- android:layout_height="60.0dip"
- android:layout_marginLeft="15dip">
- <ImageView
- android:id="@+id/userface"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:src="@drawable/face" />
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:src="@drawable/portrait_round" />
- </FrameLayout>
- <LinearLayout