Android7.0中文文档 --- RelativeLayout

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/RelativeLayout.html

RelativeLayout

public class RelativeLayout
extends ViewGroup

java.lang.Object
   ↳android.view.View
    ↳android.view.ViewGroup
     ↳android.widget.RelativeLayout


A Layout where the positions of the children can be described in relation to each other or to the parent.
在一个布局中,子项的位置可以被描述成与彼此或与父项之间的关系。

Note that you cannot have a circular dependency between the size of the RelativeLayout and the position of its children. For example, you cannot have a RelativeLayout whose height is set to WRAP_CONTENT and a child set to ALIGN_PARENT_BOTTOM.
注意,你不能在的RelativeLayout大小和其子项位置之间有一个循环依赖关系。例如,你不能有一个设置了WRAP_CONTENT的RelativeLayout,并且将一个子项设置为ALIGN_PARENT_BOTTOM

Note: In platform version 17 and lower, RelativeLayout was affected by a measurement bug that could cause child views to be measured with incorrect MeasureSpec values. (See MeasureSpec.makeMeasureSpec for more details.) This was triggered when a RelativeLayout container was placed in a scrolling container, such as a ScrollView or HorizontalScrollView. If a custom view not equipped to properly measure with the MeasureSpec mode UNSPECIFIED was placed in a RelativeLayout, this would silently work anyway as RelativeLayout would pass a very large AT_MOST MeasureSpec instead.
注意:在17或更低的平台版本中,相对布局受到一个测量bug的影响,它可能导致子视图以不正确的MeasureSpec来测量。(参考MeasureSpec.makeMeasureSpec获取更详细的信息)。当把一个RelativeLayout容器放置到一个滚动容器(如ScrollView或HorizontalScrollView)中时,这个bug将被触发。如果放置在RalativeLayout中的自定义视图使用UNSPECIFIED的MeasureSpec的模式而没有设置适当的测量,它也能工作,但是RelativeLayout会传入一个非常大的AT_MOST MeasureSpec。

This behavior has been preserved for apps that set android:targetSdkVersion="17" or older in their manifest's uses-sdk tag for compatibility. Apps targeting SDK version 18 or newer will receive the correct behavior
这种行为是为了应用程序在manifest的uses-sdk标签中设置android:targetSdkVersion="17"或更老版本中的兼容。18或更新的版本的应用程序将会得到正确的行为

See the Relative Layout guide.
请参考Relative Layout指南。

Also see RelativeLayout.LayoutParams for layout attributes
参考RelativeLayout.LayoutParams了解布局属性。

摘要


嵌套类

classRelativeLayout.LayoutParams

Per-child layout information associated with RelativeLayout. 
与RelativeLayout相关的每个子布局的信息。 

XML属性

android:gravity在一个对象自身的边界内,它如何在x轴和y坐标轴上放置其内容。 
android:ignoreGravity不受重力值影响的视图。 

继承XML属性

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值