public class UIStackView extends UIView
NoIntrinsicMetric
Constructor and Description |
---|
UIStackView(List<UIView> views)
Constructs a UIStackView with the default values for the settings.
|
Modifier and Type | Method and Description |
---|---|
void |
addArrangedSubview(UIView view)
Adds the specified view to the stack view.
|
int |
alignment()
Returns the alignment of the subviews in the stack view.
|
List<UIView> |
arrangedSubviews()
Returns the list of the subviews.
|
int |
axis()
Returns the axis of the stack view along which the subviews are
organized.
|
UIColor |
backgroundColor()
Returns this view's background color.
|
int |
distribution()
Returns the arrangement of the views along the axis of the stack view.
|
void |
insertArrangedSubview(UIView view,
int stackIndex)
Inserts the particular view to the specified index of the stack view.
|
boolean |
isBaselineRelativeArrangement()
Returns a Boolean that shows whether the spacing between consecutive
subviews in the stack is measured from their baselines.
|
boolean |
isLayoutMarginsRelativeArrangement()
Returns a Boolean that shows whether the subviews are arranged relative
to stack's layout margin.
|
CALayer |
layer()
Returns the Core Animation layer of this view that is used for rendering.
|
void |
removeArrangedSubview(UIView view)
Removes the specified view from the stack view.
|
void |
setAlignment(int UIStackViewAlignment)
Sets the alignment of the subviews perpendicular to the axis of the stack
view.
|
void |
setAxis(int UILayoutConstraintAxis)
Sets the axis of the stack view along which the subviews are organized.
|
void |
setBackgroundColor(UIColor background)
Set this view's background color.
|
void |
setBaselineRelativeArrangement(boolean baselineRelativeArrangement)
Sets a Boolean that defines whether the spacing between consecutive
subviews in the stack is measured from their baselines.
|
void |
setDistribution(int UIStackViewDistribution)
Sets the arrangement of the views along the axis of the stack
view.(horizontal or vertical)
|
void |
setLayoutMarginsRelativeArrangement(boolean layoutMarginsRelativeArrangement)
Sets a Boolean that defines whether the subviews are arranged relative to
stack's layout margin.
|
void |
setSpacing(double spacing)
Sets the distance between consecutive subviews expressed in points.
|
double |
spacing()
Returns the distance between consecutive subviews expressed in points.
|
accessibilityIdentifier, addConstraint, addConstraints, addGestureRecognizer, addLayoutGuide, addSubview, alpha, animateWithDuration, animateWithDuration, animateWithDuration, areAnimationsEnabled, autoresizesSubviews, autoresizingMask, bottomAnchor, bounds, bringSubviewToFront, center, centerXAnchor, centerYAnchor, clipsToBounds, constraints, contentCompressionResistancePriorityForAxis, contentHuggingPriorityForAxis, contentMode, convertPointFromView, convertPointToView, convertRectFromView, convertRectToView, didAddSubview, didMoveToSuperview, didMoveToWindow, drawRect, frame, gestureRecognizers, heightAnchor, hitTest, insertSubview, insetsLayoutMarginsFromSafeArea, intrinsicContentSize, invalidateIntrinsicContentSize, isHidden, isMultipleTouchEnabled, isOpaque, isUserInteractionEnabled, layoutIfNeeded, layoutMargins, layoutMarginsDidChange, layoutMarginsGuide, layoutSubviews, leadingAnchor, leftAnchor, maskView, needsUpdateConstraints, nextResponder, overrideUserInterfaceStyle, pointInside, preservesSuperviewLayoutMargins, removeConstraint, removeConstraints, removeFromSuperview, removeGestureRecognizer, removeLayoutGuide, requiresConstraintBasedLayout, restorationIdentifier, rightAnchor, safeAreaInsets, safeAreaLayoutGuide, sendSubviewToBack, setAccessibilityIdentifier, setAlpha, setAnimationBeginsFromCurrentState, setAnimationCurve, setAnimationDelay, setAnimationDuration, setAnimationRepeatAutoreverses, setAnimationRepeatCount, setAnimationsEnabled, setAnimationStartDate, setAutoresizesSubviews, setAutoresizingMask, setBounds, setCenter, setClearsContextBeforeDrawing, setClipsToBounds, setContentCompressionResistancePriority, setContentHuggingPriority, setContentMode, setFrame, setGestureRecognizers, setHidden, setInsetsLayoutMarginsFromSafeArea, setLayoutMargins, setMaskView, setMultipleTouchEnabled, setNeedsDisplay, setNeedsLayout, setNeedsUpdateConstraints, setOpaque, setOverrideUserInterfaceStyle, setPreservesSuperviewLayoutMargins, setRestorationIdentifier, setTag, setTintAdjustmentMode, setTintColor, setTransform, setTranslatesAutoresizingMaskIntoConstraints, setUserInteractionEnabled, sizeThatFits, sizeToFit, subviews, superview, tag, tintAdjustmentMode, tintColor, tintColorDidChange, topAnchor, toString, trailingAnchor, transform, transitionWithView, translatesAutoresizingMaskIntoConstraints, updateConstraints, updateConstraintsIfNeeded, userInterfaceLayoutDirection, viewForFirstBaselineLayout, viewForLastBaselineLayout, widthAnchor, willMoveToSuperview, willMoveToWindow, willRemoveSubview, window
becomeFirstResponder, isFirstResponder, resignFirstResponder, touchesBegan, touchesCancelled, touchesEnded, touchesMoved
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public void addArrangedSubview(UIView view)
view
- The view to be added to the stack view.public void insertArrangedSubview(UIView view, int stackIndex)
view
- The view to be added to the stack view.stackIndex
- The index of the stack view into which the new view
added.public void removeArrangedSubview(UIView view)
view
- The view to be removed from the stack view.public List<UIView> arrangedSubviews()
public void setAlignment(int UIStackViewAlignment)
UIStackViewAlignment
- The alignment of the subviews in the stack.UIStackViewAlignment
public int alignment()
public void setAxis(int UILayoutConstraintAxis)
UILayoutConstraintAxis
- The axis of the stack view along which the
subviews are organized.UILayoutConstraintAxis
public int axis()
UILayoutConstraintAxis
public boolean isBaselineRelativeArrangement()
public void setBaselineRelativeArrangement(boolean baselineRelativeArrangement)
baselineRelativeArrangement
- TRUE then spacing is measured from the
baselines of the subviews.public boolean isLayoutMarginsRelativeArrangement()
public void setLayoutMarginsRelativeArrangement(boolean layoutMarginsRelativeArrangement)
layoutMarginsRelativeArrangement
- TRUE sets the subviews are
arranged relative to stack's layout margin.public int distribution()
UIStackViewDistribution
public void setDistribution(int UIStackViewDistribution)
UIStackViewDistribution
- The arrangement of the views along the
axis of the stack view.UIStackViewDistribution
public double spacing()
public void setSpacing(double spacing)
spacing
- The distance between consecutive subviews expressed in
points. The default value is 0.0.public CALayer layer()
UIView
public UIColor backgroundColor()
UIView
backgroundColor
in class UIView
public void setBackgroundColor(UIColor background)
UIView
setBackgroundColor
in class UIView
background
- The view’s background color.Copyright © 2020. All rights reserved.