一、相关知识
1、Android盒模型(与css,html相同)

2、Android坐标系

二、Framelayout
帧布局顾名思义,为一层一层的显示,相互覆盖。如下图

界面代码

<FrameLayout    xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".FrameLayoutActivity">    <View        android:layout_width="match_parent"        android:background="@color/colorAccent"        android:layout_height="match_parent">View>    <View        android:layout_width="100dp"        android:background="@color/colorPrimary"        android:layout_height="100dp">View>FrameLayout>

3、RelativeLayout

界面代码

"http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context="com.netease.study.ui.layout.RelativeLayout1Activity">    "@+id/head"        android:layout_width="wrap_content"        android:layout_centerInParent="true"        android:src="@drawable/head"        android:layout_height="wrap_content"/>    "wrap_content"        android:text="@string/name"        android:layout_above="@id/head"        android:layout_alignLeft="@id/head"        android:layout_height="wrap_content"/>    "wrap_content"        android:text="@string/name"        android:layout_below="@id/head"        android:layout_alignLeft="@id/head"        android:layout_height="wrap_content"/>    "wrap_content"        android:text="@string/name"        android:layout_toRightOf="@id/head"        android:layout_alignTop="@id/head"        android:layout_height="wrap_content"/></RelativeLayout>

朋友圈类似的界面

界面代码

"http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context="com.netease.study.ui.layout.RelativeLayout2Activity">    "@+id/head"        android:layout_width="wrap_content"        android:src="@drawable/head1"        android:layout_height="wrap_content"/>    "@+id/name"        android:layout_toRightOf="@id/head"        android:layout_width="wrap_content"        android:text="@string/name"        android:gravity="center"        android:textSize="16sp"        android:textColor="@color/black"        android:layout_marginLeft="10dp"        android:layout_alignTop="@id/head"        android:layout_alignBottom="@id/head"        android:layout_height="wrap_content"/>    "@+id/desc"        android:layout_below="@id/name"        android:layout_alignLeft="@id/name"        android:layout_width="wrap_content"        android:text="@string/desc"        android:layout_height="wrap_content"/>    "10dp"        android:id="@+id/toupie"        android:layout_width="wrap_content"        android:src="@drawable/toupie"        android:scaleType="center"        android:layout_alignLeft="@id/desc"        android:layout_below="@id/desc"        android:layout_height="wrap_content"/>    "10dp"        android:layout_below="@id/toupie"        android:layout_alignLeft="@id/toupie"        android:layout_width="wrap_content"        android:text="20分钟"        android:layout_height="wrap_content"/>    "10dp"        android:id="@+id/comment"        android:layout_width="wrap_content"        android:layout_alignRight="@id/desc"        android:layout_below="@id/toupie"        android:src="@drawable/comment"        android:layout_height="wrap_content"/>    "@id/comment"        android:layout_alignTop="@id/comment"        android:layout_marginRight="10dp"        android:layout_width="wrap_content"        android:src="@drawable/love_icon"        android:layout_height="wrap_content"/></RelativeLayout>

更多相关文章

  1. Android(安卓)DialogFragment(1)
  2. Android(安卓)界面布局
  3. Android开发实例之登录界面的实现
  4. Android开发 弹出框/页面样式设置 android:theme
  5. Android界面开发推荐颜色
  6. Android进阶之代码应用技巧
  7. 4种必须知道的Android屏幕自适应解决方案
  8. android 界面布局
  9. Android(安卓)对话框【Dialog】去除白色边框代码

随机推荐

  1. android:style.xml
  2. Android(安卓)icon files
  3. Android实现多层级Spinner列表选项实时更
  4. Android项目开发注意事项
  5. android 查看 当前activity
  6. 实例教程八:采用ListView实现数据列表显示
  7. android解决同一个界面上ScrollView和百
  8. Android硬件服务访问流程
  9. android 音频总结
  10. android 设置系统屏幕亮度