Example usage for Java android.widget RelativeLayout fields, constructors, methods, implement or subclass
The text is from its open source code.
int | TRUE |
int | LEFT_OF Rule that aligns a child's right edge with another child's left edge. |
int | RIGHT_OF Rule that aligns a child's left edge with another child's right edge. |
int | ABOVE Rule that aligns a child's bottom edge with another child's top edge. |
int | BELOW Rule that aligns a child's top edge with another child's bottom edge. |
int | ALIGN_BASELINE Rule that aligns a child's baseline with another child's baseline. |
int | ALIGN_LEFT Rule that aligns a child's left edge with another child's left edge. |
int | ALIGN_TOP Rule that aligns a child's top edge with another child's top edge. |
int | ALIGN_RIGHT Rule that aligns a child's right edge with another child's right edge. |
int | ALIGN_BOTTOM Rule that aligns a child's bottom edge with another child's bottom edge. |
int | ALIGN_PARENT_LEFT Rule that aligns the child's left edge with its RelativeLayout parent's left edge. |
int | ALIGN_PARENT_TOP Rule that aligns the child's top edge with its RelativeLayout parent's top edge. |
int | ALIGN_PARENT_RIGHT Rule that aligns the child's right edge with its RelativeLayout parent's right edge. |
int | ALIGN_PARENT_BOTTOM Rule that aligns the child's bottom edge with its RelativeLayout parent's bottom edge. |
int | CENTER_IN_PARENT Rule that centers the child with respect to the bounds of its RelativeLayout parent. |
int | CENTER_HORIZONTAL Rule that centers the child horizontally with respect to the bounds of its RelativeLayout parent. |
int | CENTER_VERTICAL Rule that centers the child vertically with respect to the bounds of its RelativeLayout parent. |
int | END_OF Rule that aligns a child's start edge with another child's end edge. |
int | ALIGN_END Rule that aligns a child's end edge with another child's end edge. |
int | ALIGN_PARENT_START Rule that aligns the child's start edge with its RelativeLayout parent's start edge. |
int | ALIGN_PARENT_END Rule that aligns the child's end edge with its RelativeLayout parent's end edge. |
void | addView(View child, int index) Adds a child view. |
void | addView(View child) Adds a child view. |
void | addView(View child, int width, int height) Adds a child view with this ViewGroup's default layout parameters and the specified width and height. |
ViewPropertyAnimator | animate() This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View. |
void | bringToFront() Change the view's z order in the tree, so it's on top of other sibling views. |
void | draw(Canvas canvas) Manually render this view (and all of its children) to the given Canvas. |
T | findViewById(@IdRes int id) Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy. |
Drawable | getBackground() Gets the background drawable |
int | getBottom() Bottom position of this view relative to its parent. |
View | getChildAt(int index) Returns the view at the specified position in the group. |
int | getChildCount() Returns the number of children in the group. |
Context | getContext() Returns the context the view is running in, through which it can access the current theme, resources, etc. |
boolean | getGlobalVisibleRect(Rect r) |
int | getHeight() Return the height of your view. |
int | getId() Returns this view's identifier. |
ViewGroup.LayoutParams | getLayoutParams() Get the LayoutParams associated with this view. |
void | getLocationInWindow(@Size(2) int[] outLocation) Computes the coordinates of this view in its window. |
int | getMeasuredHeight() Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMeasuredWidth() Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ). |
Resources | getResources() Returns the resources associated with this view. |
Object | getTag() Returns this view's tag. |
int | getTop() Top position of this view relative to its parent. |
ViewTreeObserver | getViewTreeObserver() Returns the ViewTreeObserver for this view's hierarchy. |
int | getVisibility() Returns the visibility status for this view. |
int | getWidth() Return the width of your view. |
IBinder | getWindowToken() Retrieve a unique token identifying the window this view is attached to. |
float | getY() The visual y position of this view, in pixels. |
void | invalidate() Invalidate the whole view. |
void | layout(int l, int t, int r, int b) |
void | measure(int widthMeasureSpec, int heightMeasureSpec) This is called to find out how big a view should be. |
boolean | postDelayed(Runnable action, long delayMillis) Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses. |
void | removeAllViews() Call this method to remove all child views from the ViewGroup. |
void | removeView(View view) Note: do not invoke this method from #draw(android.graphics.Canvas) , #onDraw(android.graphics.Canvas) , #dispatchDraw(android.graphics.Canvas) or any related method. |
void | removeViewAt(int index) Removes the view at the specified position in the group. |
boolean | requestFocus() Call this to try to give focus to a specific view or to one of its descendants. |
void | requestLayout() |
void | setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque. |
void | setBackground(Drawable background) Set the background to a given Drawable, or remove the background. |
void | setBackgroundColor(@ColorInt int color) Sets the background color for this view. |
void | setBackgroundDrawable(Drawable background) |
void | setBackgroundResource(@DrawableRes int resid) Set the background to a given resource. |
void | setClickable(boolean clickable) Enables or disables click events for this view. |
void | setEnabled(boolean enabled) Set the enabled state of this view. |
void | setFocusable(boolean focusable) Set whether this view can receive the focus. |
void | setFocusableInTouchMode(boolean focusableInTouchMode) Set whether this view can receive focus while in touch mode. |
void | setGravity(int gravity) Describes how the child views are positioned. |
void | setHorizontalGravity(int horizontalGravity) |
void | setId(@IdRes int id) Sets the identifier for this view. |
void | setLayoutParams(ViewGroup.LayoutParams params) Set the layout parameters associated with this view. |
void | setLayoutTransition(LayoutTransition transition) Sets the LayoutTransition object for this ViewGroup. |
void | setOnClickListener(@Nullable OnClickListener l) Register a callback to be invoked when this view is clicked. |
void | setOnDragListener(OnDragListener l) Register a drag event listener callback object for this View. |
void | setOnLongClickListener(@Nullable OnLongClickListener l) Register a callback to be invoked when this view is clicked and held. |
void | setOnTouchListener(OnTouchListener l) Register a callback to be invoked when a touch event is sent to this view. |
void | setPadding(int left, int top, int right, int bottom) Sets the padding. |
void | setSaveEnabled(boolean enabled) Controls whether the saving of this view's state is enabled (that is, whether its #onSaveInstanceState method will be called). |
void | setScaleX(float scaleX) Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width. |
void | setScaleY(float scaleY) Sets the amount that the view is scaled in Y around the pivot point, as a proportion of the view's unscaled width. |
void | setSelected(boolean selected) Changes the selection state of this view. |
void | setTag(final Object tag) Sets the tag associated with this view. |
void | setTag(int key, final Object tag) Sets a tag associated with this view and a key. |
void | setVerticalGravity(int verticalGravity) |
void | setVisibility(@Visibility int visibility) Set the visibility state of this view. |
void | setY(float y) Sets the visual y position of this view, in pixels. |
void | startAnimation(Animation animation) Start the specified animation now. |
void | updateViewLayout(View view, ViewGroup.LayoutParams params) |