当前位置: 首页 > news >正文

起名网站是怎么做的/天津百度关键词排名

起名网站是怎么做的,天津百度关键词排名,设计制作一个企业类型网站,网站没有index.htmlAndroid布局详解Android 布局是开发中非常重要的一个知识部分,它的布局分为以下几种:Linear Layout:线性布局Relative Layout:相对布局Table Layout:表格布局Grid View:网格布局Tab Layout:选项…

Android布局详解

Android 布局是开发中非常重要的一个知识部分,它的布局分为以下几种:

Linear Layout:线性布局Relative Layout:相对布局Table Layout:表格布局Grid View:网格布局Tab Layout:选项卡布局List View:列表布局

如下图:

fc39ea50259f401db3e9fa7e3938ea7a.png

一、Linear Layout

简单来说,直着排,横着排都可以,还可以嵌套,此布局运用的非常多。

android:orientation定义布局内的方向水平或垂直(horizontal/vertical)

android:layout_weight子元素对未占用空间【水平或垂直】分配权重值,其值越小,权重越大。

android:layout_width-  宽(1.fill_parent: 父元素决定,2.wrap_content: 本身的内容决定)

android:layout_height- 高(3.高直接指定一个 px 值);

android:gravity-内容的排列形式(常用top, bottom, left, right, center,Left|center_)

下面直接上示例代码及截图:

80c30f26871727ef98245856554aa968.png

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#aa0000"

android:gravity="center_horizontal"

android:text="red" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#00aa00"

android:gravity="center_horizontal"

android:text="green" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#0000aa"

android:gravity="center_horizontal"

android:text="blue" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#aaaa00"

android:gravity="center_horizontal"

android:text="yellow" />

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="vertical" >

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="row one"

android:textSize="15pt" />

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="row two"

android:textSize="15pt" />

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="row three"

android:textSize="15pt" />

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="row four"

android:textSize="15pt" />

下面详细详解这些配置的含义:

LinearLayout 标签的常用属性

android:orientation="horizontal":定义方向水平或垂直(horizontal/vertical)

android:layout_width="fill_parent" :宽度填充满父控件的宽度

android:layout_height="fill_parent":宽度填充满父控件的高度

android:layout_weight="1":重量?可解释为权重,这是个什么意思呢,请看下图

d0e44e243f9af8b02d997f6925e36bb6.png

我将这里的配置变了一下,

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#aa0000"

android:gravity="center_horizontal"

android:text="red" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="2"

android:background="#00aa00"

android:gravity="center_horizontal"

android:text="green" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="3"

android:background="#0000aa"

android:gravity="center_horizontal"

android:text="blue" />

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="4"

android:background="#aaaa00"

android:gravity="center_horizontal"

android:text="yellow" />

可以看到我设置成了

1,

2,

3,

4,这四

TextView显示的宽度不一样了,具体是怎么算的,这个我们就不追究了,意思清楚就行,都设置为

1则平分,否则数给的越大,占的位置就越多。

再看一下TextView的解释

android:layout_width="wrap_content"

android:layout_height="fill_parent"

android:layout_weight="1"

android:background="#aa0000"

android:gravity="center_horizontal"

android:text="red" />

android:text="red":要显示的内容

android:gravity="center_horizontal":显示内容的对齐方式

android:background="#aa0000" :背景色

android:layout_width="wrap_content":宽度,包括自己的内容的宽度

android:layout_height="fill_parent":高度,填充父控件的高度

android:layout_weight="1":权重

其实含义如果懂些CSS属性的话,还是蛮好懂的,布局跟Div有点类似

//类似一个外层DIV,里面的内容垂直布局android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

//类似第一个子DIV,内容水平布局android:orientation="horizontal"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="horizontal" >

//类似第二个子DIV,内容垂直布局android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="vertical" >

http://www.lbrq.cn/news/1443493.html

相关文章:

  • 代理做减肥网站/百度seo关键词排名查询
  • 深圳做网站制作/网站查询域名入口
  • 南昌企业网站设计/全网营销推广公司
  • 成都网站建设十强企业/关键词在线查询
  • 网站开发框架具体使用方法/淘宝关键词指数查询
  • 深圳网站开发专业团队/石家庄网络营销
  • 深圳的建站公司/自己开网站怎么开
  • 西安网站建设设计的好公司/磁力链
  • 网站背景图片怎么做/百度无锡营销中心
  • 做国际交友网站翻译/整合营销经典案例
  • phpmysql网站开发案例/网络营销的三种方式
  • 国外做黄漫的网站/地推一手项目平台
  • 做社交网站开发/怎样无货源开网店
  • 网站上传好了如何做定向/搜索引擎优化方法有哪些
  • 给网站写教案做课件一节课多少钱/公司网站设计要多少钱
  • 如何防止php网站被挂马/厦门seo
  • 已有网站如何做直播/黑帽seo寄生虫
  • 做海报找背景图有哪些网站/全球搜索
  • php发布post到wordpress/百度seo优
  • 政府网站手机版建设方案/推广一单500
  • 做网站劫持多少钱/做个网站
  • 网页微博如何退出登录/网站的优化公司
  • 广州市地铁线路最新全图/在线seo超级外链工具
  • crm系统是干什么的/廊坊seo排名外包
  • 网上商城项目设计方案/郑州seo网站有优化
  • 动易网站首页制作/最全的搜索引擎
  • 建电影网站教程/百度统计登录
  • 企业网站建设遵循的原则/网店运营流程步骤
  • 廊坊建站模板系统/广告推广方案
  • 在线考试类网站怎么做/百度网盘官网下载
  • 云计算分类与主流产品
  • k8s 命令记录
  • 深入浅出DBSCAN:基于密度的聚类算法详解与Python实战
  • 【LeetCode】102 - 二叉树的层序遍历
  • 编译技术的两条演化支线:从前端 UI 框架到底层编译器的智能测试
  • 202506 电子学会青少年等级考试机器人三级器人理论真题