Android7.0中文文档(API)--- FrameLayout

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

FrameLayout

public class FrameLayout
extends ViewGroup

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


FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other. You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the android:layout_gravity attribute.
FrameLayout被设计用来屏蔽屏幕上的一个区域,以显示一个单独的项。一般来说,FrameLayout应该被用来容纳一个单独的子视图,因为它很难组织多个子视图,这种方式可以扩展到不同的屏幕大小,而不需要子项相互重叠。但是,你可以通过使用android:layout_gravity属性,将多个子项添加到FrameLayout中,并在FrameLayout内控制它们的位置。

Child views are drawn in a stack, with the most recently added child on top. The size of the FrameLayout is the size of its largest child (plus padding), visible or not (if the FrameLayout's parent permits). Views that are GONE are used for sizing only if setConsiderGoneChildrenWhenMeasuring() is set to true.
子视图是在栈中绘制的,其中最近添加的子项放置在顶部。FrameLayout大小是它最大的子项(加上内边距(padding))的大小,包括可见的或不可见的子项(如果FrameLayout的父项允许的话)。只有当setConsiderGoneChildrenWhenMeasuring()被设置为true时,才会使用GONE的视图。

摘要


嵌套类

classFrameLayout.LayoutParams

Per-child layout information for layouts that support margins. 
布局的每个子布局的信息,其支持外边距(marging)。 

XML属性

android:foregroundGravity设置重力,用于前景drawable。 
android:measureAllChildren决定是否测量所有的子项,或者仅仅测量那些在VISIBLE或INVISIBLE状态下的子项。 

继承XML属性

From class android.view.ViewGroup
From class android.view.View

继承常量

From class android.view.ViewGroup
From class android.view.View

继承字段

From class android.view.View

Public构造方法

FrameLayout(Context context)
FrameLayout(Context context, AttributeSet attrs)
FrameLayout(Context context, AttributeSet attrs, int defStyleAttr)
FrameLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public方法

FrameLayout.LayoutParamsgenerateLayoutParams(AttributeSet attrs)

Returns a new set of layout parameters based on the supplied attributes set.
基于提供的一组属性,返回一组新的布局参数。

CharSequencegetAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。

booleangetConsiderGoneChildrenWhenMeasuring()

This method was deprecated in API level 14. This method is deprecated in favor of getMeasureAllChildren(), which was renamed for consistency with setMeasureAllChildren().
此方法在API level 14版本中被删除。此方法不再支持,而用getMeasureAllChildren()替代, 以保持与setMeasureAllChildren() 的一致性。

booleangetMeasureAllChildren()

Determines whether all children, or just those in the VISIBLE or INVISIBLE state, are considered when measuring.
决定是否测量所有的子项,或者仅仅测量那些在VISIBLE或INVISIBLE状态下的子项。

voidsetForegroundGravity(int foregroundGravity)

Describes how the foreground is positioned.
获取前景如何放置。

voidsetMeasureAllChildren(boolean measureAll)

Sets whether to consider all children, or just those in the VISIBLE or INVISIBLE state, when measuring.
设置是否在测量时考虑所有的子项,或者仅仅测量那些在VISIBLE或INVISIBLE状态下的子项。

booleanshouldDelayChildPressedState()

Return true if the pressed state should be delayed for children or descendants of this ViewGroup.
如果这个ViewGroup的子项要延迟按下的状态,则返回true。

保护方法

完整内容,请查看: http://www.zhdoc.net/android/reference/android/widget/FrameLayout.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值