FrameLayout API

来源:互联网 发布:电信计费模拟c语言 编辑:程序博客网 时间:2024/05/21 09:26

android.widget.FrameLayout

 

public class FrameLayout extends ViewGroup

 

@RemoteView

FrameLayout is designed to block out an areaon the screen to display a single item. Generally, FrameLayout should be usedto hold a single child view, because it can be difficult to organize childviews in a way that's scalable to different screen sizes without the childrenoverlapping each other. You can, however, add multiple children to aFrameLayout and control their position within the FrameLayout by assigninggravity to each child, using theandroid:layout_gravityattribute.

 

Child views are drawn in a stack, with themost recently added child on top. The size of the FrameLayout is the size ofits largest child (plus padding), visible or not (if the FrameLayout's parentpermits). Views that areandroid.view.View.GONE are used for sizingonly ifsetConsiderGoneChildrenWhenMeasuring() is set to true.

 

@attr

refandroid.R.styleable#FrameLayout_foreground

@attr

ref android.R.styleable#FrameLayout_foregroundGravity

@attr

refandroid.R.styleable#FrameLayout_measureAllChildren

 

 

译文:

 

FrameLayout 为了显示一个但一的项目去有计划地遮挡屏幕上的一些地方。

FrameLayout 应该用于控制单一的子视图,因为它很难通过 在保持子视图不重叠的情况下扩展到不同尺寸的屏幕上。 的方法组织子视图。

如果一定要在一个 FrameLayout 添加多个子视图,你可以通过android:layout_gravity attribute. 属性来控制 子视图的位置。

 

新加入这个容器的子视图存在于它之前的子视图之上。

FrameLayout的大小是它所包含的子视图中最大的子视图的大小(包括padding),FrameLayout的父视图有权控制这个FrameLayout是否显示。

Views that are android.view.View.GONE are used for sizingonly ifsetConsiderGoneChildrenWhenMeasuring() is set to true.【并不理解】


@属性

ref android.R.styleable#FrameLayout_foreground

@属性

ref android.R.styleable#FrameLayout_foregroundGravity

@属性

ref android.R.styleable#FrameLayout_measureAllChildren


关于方法----http://android.toolib.net/reference/android/widget/FrameLayout.html

0 0
原创粉丝点击