脸萌2 首页布局
来源:互联网 发布:网络攻防技术 课本 编辑:程序博客网 时间:2024/05/11 18:08
今天最主要完成的是布局,明天就要完成监控。好激动啊
来整理下
1、线性布局 LinearLayout 控件从上到下排列或者从左到右排列
2、相对布局 RelativeLayout 根据参考物来设置相对位置
3、帧布局 FrameLayout 每个控件,独占一层
4、表格布局 TableLayout 可以制作表格
5、绝对布局 AbsoluteLayout 根据坐标点来确定屏幕位置(地图、2D图形绘制)
RelativeLayout:
1、表示当前控件和父容器之间的位置关系:
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
2、控件和控件之间表示方位的位置关系:
android:layout_above="@+id/center"
android:layout_below="@+id/center"
android:layout_toRightOf="@+id/center"
android:layout_toLeftOf="@+id/center"
3、控件和控件之间表示对齐的位置关系
android:layout_alignTop="@+id/center"
android:layout_alignBottom="@+id/center"
android:layout_alignRight="@+id/center"
android:layout_alignLeft="@+id/center"
4、控件和空间之间的距离关系
android:layout_marginRight="10dip"
android:layout_marginTop="10dip"
android:layout_marginBottom="10dip"
android:layout_marginLeft="10dip"
android:layout_margin="10dip"
5、控件和内部内容之间的位置关系
android:gravity="right|center_vertical"
6、控件和内部内容之间的距离关系
android:paddingRight="20dip"
android:paddingLeft="20dip"
android:paddingTop="20dip"
android:paddingBottom="20dip"
android:padding="20dip"
控件和内部内容之间位置关系
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<!-- 整体两个布局
相对布局 线性布局 -->
<!-- 线性布局中又有三个线性布局 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/image_sound"
android:layout_alignParentLeft="true"
android:src="@drawable/bt_homepage_sound_on"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/image_reply"
android:layout_alignParentRight="true"
android:src="@drawable/bt_yijianfankui_up"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="80dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/pic_startpage_logo"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bt_man_up"
android:id="@+id/bt_man_up"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bt_woman_up"
android:id="@+id/bt_woman_up"
android:layout_toRightOf="@+id/bt_man_up"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
>
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/bt_gift_up"
android:id="@+id/zhuanshut"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dip"
/>
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/bt_more_up"
android:id="@+id/more"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
稍后把文件上传。埋头做事。
- 脸萌2 首页布局
- 首页布局
- 第2章 网站首页的布局
- 页面布局-百度首页
- mui教程 首页布局
- 首页头部提示布局
- index首页布局
- Flask实战2问答平台-首页布局,功能完成
- 网站首页应该如何布局
- div简单布局网站首页
- 京东首页布局实现
- 仿sohu首页布局演示
- TabLayout布局之首页搭建
- IOS 商城首页简单布局
- DIV+CSS首页布局练习
- 一个简单首页的布局
- RecycleView 实现复杂首页布局
- CSS布局欣赏:淘宝首页布局效果
- Java的特征之一 封装
- 混日子不是你的错,根源在这里
- 临界区、互斥量、信号量、事 件
- 微信支付趟坑之旅之单页面应用
- 柴俊理金:6月22号早间现货黄金,宁贵沥青操作建议
- 脸萌2 首页布局
- 勾股定理一日一证连载30
- cudav7.5+anaconda3.5+Theano+vs2012失败经验
- 15.2节练习
- BM关键字搜索算法学习实践
- php phpize报错
- 不能声明为虚函数的情况
- 小白进阶之线性排序算法之计数排序、基数排序和桶排序
- docker容器资源配额控制