Beispiel #1
0
 /// <summary>
 /// 添加一个子View
 /// </summary>
 /// <param name="view">被添加的view</param>
 public void AddSubview(UILayout view)
 {
     if (view == null)
     {
         return;
     }
     view.RectTransform.SetParent(RectTransform);
     if (view.SuperView != null)
     {
         view.SuperView.RemoveView(view);
     }
     view.SuperView = this;
     Subviews.Add(view);
 }
Beispiel #2
0
        protected AbsAdapterView()
        {
            ScrollRect = UIObject.AddComponent <ScrollRect>();
            ScrollRect.onValueChanged.AddListener(OnScroll);
            EventHandler = UIObject.AddComponent <PointerClickHandler>();
            EventHandler.AbsAdapterView = this;
            var contentView = new UILayout {
                UIObject = { name = "Content View" }
            };

            AddSubview(contentView);
            ContentTransform                  = contentView.RectTransform;
            ContentTransform.pivot            = ContentTransform.anchorMin = ContentTransform.anchorMax = new Vector2(0, 1);
            ContentTransform.anchoredPosition = Vector2.zero;
            ScrollRect.content                = ContentTransform;

            ScrollOrentation = ScrollOrentation.Vertical;

            BackgroundColor      = Color.black;
            Mask                 = UIObject.AddComponent <Mask>();
            Mask.showMaskGraphic = true;
        }
Beispiel #3
0
 public ButtonView(UILayout layout)
     : base(layout)
 {
     Button = UIObject.AddComponent <Button>();
 }
Beispiel #4
0
 public RadioButtonView(UILayout layout) : base(layout)
 {
 }
Beispiel #5
0
 public static void FrameFill(UILayout layout)
 {
 }
Beispiel #6
0
 public virtual void RemoveView(UILayout view)
 {
     Subviews.Remove(view);
 }
Beispiel #7
0
 public virtual void MoveToView(UILayout view)
 {
     view.RectTransform.SetParent(view.RectTransform);
     view.SuperView = view;
 }
Beispiel #8
0
 public UILayout(UILayout layout)
 {
     UIObject      = BaseLayout();
     RectTransform = UIObject.GetComponent <RectTransform>();
     layout.AddSubview(this);
 }
Beispiel #9
0
 public UIView(UILayout layout) : base(layout)
 {
     CanvasRenderer = UIObject.AddComponent <CanvasRenderer>();
 }
Beispiel #10
0
 public void Append(UILayout layout)
 {
 }
Beispiel #11
0
 public TextView(UILayout layout)
     : base(layout)
 {
     TextComponent = UIObject.AddComponent <Text>();
     Font          = UIViewManager.GetInstance().Font;
 }
Beispiel #12
0
 public ImageView(UILayout layout) : base(layout)
 {
 }