简体   繁体   中英

How to add a sibling view in Visual Studio Xamarin.ios designer?

This is my first Xamarion.IOS project and I have a view controller with the following heirarchy:

在此处输入图片说明

View Controller with an "Outer" Stack View (Parent).

This outer stack view should have two children:

  • Child1 - a View taking up the top 30% of the screen which I've also managed to add as you can see below.
  • Child2 - another Stack View taking up the remaining 70% of the screen.

The problem is in Visual Studio 2017 designer when I try to drag a Stack View onto the Parent, it gets set as a child of Child1 because Child1 is taking up the full space of the Parent so there's no space to drag it unto Parent.

I tried playing around with the properties of both Child1 and Parent so that there is some space to add Child2 to Parent but I haven't been successful so far. I could do that by removing AutoLayout for the whole storyboard but I want to keep that setting as I am porting from an XCode project which has the setting and I don't want to screw around. Also seems a bit overkill that I have to remove AutoLayout everytime I need to add a sibling.

There doesn't seem to be a way to drag the view size to limit it's height. Even the "Fill Parent" buttons on the Layout tab cannot be "unchecked". Can anyone help me please?

It seems that you need to add the constraints to your Child1 and Child2. Check how in this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM