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;
                }
            }
        }
Ejemplo n.º 2
0
 public void SetAnchor(UIAnchorStyle anchors)
 {
     _button.anchor = anchors;
 }