Android7.0中文文档 --- RelativeLayout
来源:互联网 发布:宁波市软件行业协会 编辑:程序博客网 时间:2024/05/17 06:07
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/RelativeLayout.html
RelativeLayout
public class RelativeLayout
extendsViewGroup
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 toWRAP_CONTENT
and a child set toALIGN_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 incorrectMeasureSpec
values. (SeeMeasureSpec.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 modeUNSPECIFIED
was placed in a RelativeLayout, this would silently work anyway as RelativeLayout would pass a very largeAT_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'suses-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
了解布局属性。
摘要
嵌套类
class
RelativeLayout.LayoutParams
Per-child layout information associated with RelativeLayout.
与RelativeLayout相关的每个子布局的信息。
XML属性
android:gravity
在一个对象自身的边界内,它如何在x轴和y坐标轴上放置其内容。 android:ignoreGravity
不受重力值影响的视图。 继承XML属性
- Android7.0中文文档 --- RelativeLayout
- Android7.0中文文档(API)-- RelativeLayout.LayoutParams
- Android7.0中文文档 --- CheckBox
- Android7.0中文文档 --- CompoundButton
- Android7.0中文文档 -- AdapterViewFlipper
- Android7.0中文文档 --- EditText
- Android7.0中文文档 -- Space
- Android7.0中文文档 -- GridLayout
- Android7.0中文文档(API) -- HorizontalScrollView
- Android7.0中文文档(API)--- FrameLayout
- Android7.0中文文档(API)--- CalendarView
- Android7.0中文文档(API)--- DatePicker
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API)--- TabHost
- Android7.0中文文档(API) -- TimePicker
- Android7.0中文文档(API)-- ViewAnimator
- Android7.0中文文档(API)--- AbsoluteLayout
- Android7.0中文文档(API) -- Switch
- C语言的HashTable简单实现
- QT QML初体验随笔之QQuickView(14)
- idea列编辑模式
- 含对象成员类的构造顺序
- 【Androidd Release】AndroidStudio 发布apk 提示资源文件未翻译
- Android7.0中文文档 --- RelativeLayout
- 【模板】Manacher 算法 最长回文子串
- $.ajax()方法详解
- 在android studio中打印日志无显示
- 19 《黑石头的爱与恨:煤的故事》 -豆瓣评分7.4
- 几种常见模式识别算法整理和总结【转】
- tensorflow 错误总结
- Jmeter初次使用记录-入门
- MFC注册表操作