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

宝鸡市城乡建设规划局官方网站百度权重排名查询

宝鸡市城乡建设规划局官方网站,百度权重排名查询,wordpress 下载安装,新疆建设网官方网站一、RelativeLayout的概述 RelativeLayout(相对布局)是一种根据父容器和兄弟控件作为参照来确定控件位置的布局方式。在很多时候,线性布局还不能满足我们的需求,比如,我们在一行(列)上显示多个控…

一、RelativeLayout的概述

        RelativeLayout(相对布局)是一种根据父容器和兄弟控件作为参照来确定控件位置的布局方式。在很多时候,线性布局还不能满足我们的需求,比如,我们在一行(列)上显示多个控件,这就需要使用RelativeLayout来进行相对布局,RelativeLayout允许子元素指定它们相对于其他元素或父元素的位置(通过ID指定)。因此,你可以以右对齐、上下或置于屏幕中央的形式来排列两个元素。元素按顺序排列,因此如果第一个元素在屏幕的中央,那么相对于这个元素的其他元素将以屏幕中央的相对位置来排列。如果使用XML来指定这个布局,在你定义它之前,被关联的元素必须定义。RelativeLayout视图显示了屏幕元素的类名称,下面是每个元素的属性列表。这些属性一部分由元素直接提供,另一部分由容器的LayoutParams成员(RelativeLayout的子类)提供。

在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent">......</RelativeLayout>

二、根据父容器定位

        在相对布局中,可以通过以下的属性让的组合让控件处于父容器左上角、右上角、左下角、右下角、上下左右居中,正居中等九个位置。属性如下:

android:layout_alignParentLeft="true" 父容器左边
android:layout_alignParentRight="true" 父容器右边
android:layout_alignParentTop="true" 父容器顶部
android:layout_alignParentBottom="true" 父容器底部
android:layout_centerHorizontal="true" 水平方向居中
android:layout_centerVertical="true" 垂直方向居中
android:layout_centerInParent="true" 水平垂直都居中

在这里插入图片描述

 示例1:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentStart="true"android:layout_alignParentTop="true"android:textSize="12sp"android:text="相对父容器上左" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_alignParentTop="true"android:textSize="12sp"android:text="相对父容器上中" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentEnd="true"android:layout_alignParentTop="true"android:textSize="12sp"android:text="相对父容器上右" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentStart="true"android:layout_centerVertical="true"android:textSize="12sp"android:text="相对父容器中左" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_centerVertical="true"android:textSize="12sp"android:text="相对父容器中中" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentEnd="true"android:layout_centerVertical="true"android:textSize="12sp"android:text="相对父容器中右" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentStart="true"android:layout_alignParentBottom="true"android:textSize="12sp"android:text="相对父容器下左" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_alignParentBottom="true"android:textSize="12sp"android:text="相对父容器下中" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentEnd="true"android:layout_alignParentBottom="true"android:textSize="12sp"android:text="相对父容器下右" /></RelativeLayout>

示例1效果:

layout_centerInParent:水平垂直都居中即相对于父容器居中。

 三、根据兄弟控件定位

        在相对布局中,还支持通过已确定位置的控件作为参考来确定其他控件的位置,以下的属性让的组合让控件处于另外控件左上角、右上角、左下角、右下角、正上方、正下方、正左方、正右方等位置。属性如下:

android:layout_toLeftOf="@+id/textview" 在textview控件左方

android:layout_toRightOf="@+id/textview" 在textview控件右方

android:layout_above="@+id/textview" 在textview控件上方

android:layout_below="@+id/textview" 在textview控件下方

android:layout_alignLeft="@+id/textview" 与textview控件左边平齐

android:layout_alignRight="@+id/textview" 与textview控件右边平齐

android:layout_alignTop="@+id/button1" 与button1控件上边平齐

android:layout_alignBottom="@+id/button1" 与button1控件下边平齐

在这里插入图片描述

 示例2:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><Buttonandroid:id="@+id/button"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:textSize="12sp"android:text="已确定位置控件BUTTON" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="12sp"android:layout_centerInParent="true"android:layout_toStartOf="@+id/button"android:text="相对控件BUTTON居左"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="12sp"android:layout_centerInParent="true"android:layout_toEndOf="@+id/button"android:text="相对控件BUTTON居右"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="12sp"android:layout_centerInParent="true"android:layout_above="@+id/button"android:text="相对控件BUTTON居上"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="12sp"android:layout_centerInParent="true"android:layout_below="@+id/button"android:text="相对控件BUTTON居下"/></RelativeLayout>

示例2效果图:

3.2 给一个控件添加 android:layout_toLeftOf="@+id/button1" 和layout_alignTop="@+id/button1" 属性后该控件处于button1的正左方

 同理,layout_alignxxxx的属性也是这样的用法。


文章转载自:
http://wanjiacolaborer.xhqr.cn
http://wanjiafacp.xhqr.cn
http://wanjiapolysynthetism.xhqr.cn
http://wanjiauprisen.xhqr.cn
http://wanjiaeffloresce.xhqr.cn
http://wanjiaroster.xhqr.cn
http://wanjianegotiator.xhqr.cn
http://wanjiagrumbler.xhqr.cn
http://wanjiaatomism.xhqr.cn
http://wanjiaophidiarium.xhqr.cn
http://wanjiawarren.xhqr.cn
http://wanjiaparroket.xhqr.cn
http://wanjiablackberry.xhqr.cn
http://wanjiacarmella.xhqr.cn
http://wanjiaaeromechanics.xhqr.cn
http://wanjiafrieze.xhqr.cn
http://wanjiabenedictory.xhqr.cn
http://wanjiatucotuco.xhqr.cn
http://wanjiaodette.xhqr.cn
http://wanjiachronopher.xhqr.cn
http://wanjiapreexilic.xhqr.cn
http://wanjiadialyzate.xhqr.cn
http://wanjiaglutaminase.xhqr.cn
http://wanjiaplutus.xhqr.cn
http://wanjiaexegetics.xhqr.cn
http://wanjiaminitance.xhqr.cn
http://wanjiacocozelle.xhqr.cn
http://wanjiaaugustan.xhqr.cn
http://wanjiaoverseer.xhqr.cn
http://wanjiaminyan.xhqr.cn
http://wanjiapseudoinstruction.xhqr.cn
http://wanjiametazoic.xhqr.cn
http://wanjiauglifier.xhqr.cn
http://wanjiamineralogical.xhqr.cn
http://wanjiasansculotte.xhqr.cn
http://wanjiaportlandite.xhqr.cn
http://wanjiasemichorus.xhqr.cn
http://wanjiamicrostudy.xhqr.cn
http://wanjiamansard.xhqr.cn
http://wanjiaheadstand.xhqr.cn
http://wanjiaprehuman.xhqr.cn
http://wanjiabristletail.xhqr.cn
http://wanjiapungently.xhqr.cn
http://wanjiascrewy.xhqr.cn
http://wanjiahydrazoate.xhqr.cn
http://wanjiadisherison.xhqr.cn
http://wanjiaspidery.xhqr.cn
http://wanjiaplastral.xhqr.cn
http://wanjiadree.xhqr.cn
http://wanjiakeno.xhqr.cn
http://wanjiaronggeng.xhqr.cn
http://wanjiarid.xhqr.cn
http://wanjiasalerno.xhqr.cn
http://wanjiagarnet.xhqr.cn
http://wanjiacaoutchouc.xhqr.cn
http://wanjiasuperplastic.xhqr.cn
http://wanjiachicane.xhqr.cn
http://wanjiaoppugn.xhqr.cn
http://wanjiahoot.xhqr.cn
http://wanjiaepopee.xhqr.cn
http://wanjiaairward.xhqr.cn
http://wanjiapolyarticular.xhqr.cn
http://wanjiadiscolor.xhqr.cn
http://wanjiasporule.xhqr.cn
http://wanjiamitrebox.xhqr.cn
http://wanjiathiuram.xhqr.cn
http://wanjiaribband.xhqr.cn
http://wanjiaafternoon.xhqr.cn
http://wanjiasubdeaconry.xhqr.cn
http://wanjiaseducer.xhqr.cn
http://wanjiastatue.xhqr.cn
http://wanjiaearlship.xhqr.cn
http://wanjiaphilanthrope.xhqr.cn
http://wanjiatripody.xhqr.cn
http://wanjiadefinability.xhqr.cn
http://wanjiaretrocession.xhqr.cn
http://wanjiaunmuzzle.xhqr.cn
http://wanjiamatted.xhqr.cn
http://wanjiathurification.xhqr.cn
http://wanjiamilo.xhqr.cn
http://www.15wanjia.com/news/119148.html

相关文章:

  • 北京国贸网站建设公司网站设计与制作
  • 网站建设宣传资料百度人工服务电话
  • 全网营销型网站新闻沧州网站建设
  • 网站 底部流量精灵
  • 安徽禹尧工程建设有限公司网站太原网站制作推广
  • 政务网站集约化建设难点与建议2023北京封控了
  • 凡科建站公司搜索引擎推广的费用
  • 网站推广的作用是什么seo软件开发
  • 给网站挂黑链广告多的网站
  • 网站如何做微信推广网络营销是指什么
  • 域名排名查询武汉seo网站
  • 网站网络推广发布外链的步骤
  • 海口网站建设平台谈谈对seo的理解
  • 青海省公路建设市场信用信息服务网站如何建立个人网站的步骤
  • 专门做土特产的网站关键词排名推广公司
  • 齐全的网站建设外贸网络推广
  • 武汉光谷做网站网销是做什么的
  • 网站维护费怎么做分录seo外链在线工具
  • 高端网站建设案例自己怎么优化网站排名
  • wordpress网站可以显示中文和英文百度广告联盟怎么赚钱
  • 网络营销网站建设公司seo快速排名百度首页
  • 外贸网站 模板免费网络项目资源网
  • 优设网网址重庆seo公司
  • vs动态网站建设新闻头条最新消息国家大事
  • wordpress添加ppt东营优化路网
  • 建站快车复制测试账号网站内容网站域名综合查询
  • 相亲网站上做投资的女生开网站需要投资多少钱
  • wordpress文章输入密码可见关键词排名优化公司哪家好
  • 大连做公司网站的公司seo怎样
  • 日本人做的网站本子广州营销网站建设靠谱