public static void EnsureUIComponentsLayout() { UIComponent[] componentsInChildren = UIView.GetAView().GetComponentsInChildren <UIComponent>(); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != null) { // This ensure component layout is created // To avoid exception when OnResolutionChanged is called UIAnchorStyle anchor = componentsInChildren[i].anchor; } } }
public void SetAnchor(UIAnchorStyle anchors) { _button.anchor = anchors; }