English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.FrameLayout

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.view.ViewGroup ViewManager ViewParent
android.widget.FrameLayout

FrameLayout is designed to block out an area on the screen to display a single item. You can add multiple children to a FrameLayout, but all children are pegged to the top left of the screen (you cannot specify a child's placement). Children are drawn in a stack, with the most recently added child on top. The size of the frame layout 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.

Also see ViewGroup.LayoutParams for layout attributes.

Known Direct Subclasses
Known Indirect Subclasses

Summary

XML Attributes

Attribute name Related methods  
android:foreground setForeground(Drawable)
 
 
android:measureAllChildren setMeasureAllChildren(boolean)
 
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. 
XML Attributes inherited from class android.view.ViewGroup
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.ViewGroup
Constants inherited from class android.view.View

Fields

protected      boolean  mMeasureAllChildren   
Fields inherited from class android.view.ViewGroup
Fields inherited from class android.view.View

Public Constructors

          FrameLayout(Context context)
          FrameLayout(Context context, AttributeSet attrs, Map inflateParams)
          FrameLayout(Context context, AttributeSet attrs, Map inflateParams, int defStyle)

Public Methods

        void  draw(Canvas canvas)
Manually render this view (and all of its children) to the given Canvas.
        boolean  gatherTransparentRegion(Region region)
This is used by the RootView to perform an optimization when the view hierarchy contains one or several SurfaceView.
        boolean  getConsiderGoneChildrenWhenMeasuring()
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring.
        Drawable  getForeground()
        void  setForeground(Drawable drawable)
Supply a Drawable that is to be rendered on top of all of the child views in the frame layout.
        void  setMeasureAllChildren(boolean measureAll)
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring.

Protected Methods

        void  drawableStateChanged()
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.
        void  onLayout(boolean changed, int l, int t, int r, int b)
Called from layout when this view should assign a size and position to each of its children.
        void  onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Measure the view and its content to determine the measured width and the measured height.

        void  onSizeChanged(int w, int h, int oldw, int oldh)
This is called during layout when the size of this view has changed.
        boolean  verifyDrawable(Drawable who)
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.
Methods inherited from class android.view.ViewGroup