简体   繁体   English

如何在Visual Studio Xamarin.ios设计器中添加同级视图?

[英]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: 这是我的第一个Xamarion.IOS项目,并且我具有一个具有以下层次结构的视图控制器:

在此处输入图片说明

View Controller with an "Outer" Stack View (Parent). 具有“外部”堆栈视图(父级)的View Controller。

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. Child1-视图占据了屏幕的前30%,我也设法添加了它,如下所示。
  • Child2 - another Stack View taking up the remaining 70% of the screen. Child2-另一个堆栈视图占据了屏幕的剩余70%。

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. 问题是在Visual Studio 2017设计器中,当我尝试将Stack View拖动到Parent时,它被设置为Child1的子级,因为Child1占用了Parent的全部空间,因此没有空间将其拖动到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. 我尝试使用Child1和Parent的属性,以便有一些空间可以将Child2添加到Parent,但是到目前为止,我还没有成功。 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. 我可以通过删除整个情节提要的AutoLayout来做到这一点,但是我想保留该设置,因为我是从具有该设置的XCode项目中移植的,所以我不想搞砸。 Also seems a bit overkill that I have to remove AutoLayout everytime I need to add a sibling. 每次需要添加同级项时都必须删除AutoLayout似乎也有些过分。

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. 似乎您需要将约束添加到您的Child1和Child2。 Check how in this link 检查此链接的方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加Visual Studio Xamarin.iOS项目中不可用的文本文件 - Add text file not available in Xamarin.iOS project in visual studio 如何在 Windows Visual Studio xamarin.ios 应用程序中将密钥 NSBluetoothPeripheralUsageDescription 添加到 info.plist - How to add key NSBluetoothPeripheralUsageDescription to info.plist in a Windows Visual Studio xamarin.ios app 如何使用Visual Studio 2017在Mac上更新xamarin.ios? - how to update xamarin.ios on mac using visual studio 2017? 无法在Visual Studio Xamarin中打开设计器视图 - Unable to open designer view in visual studio xamarin 如何在运行时折叠 Xamarin.iOS 中的视图? - How to collapse a view in Xamarin.iOS in runtime? 如何在Xamarin Studio中使用iOS Designer添加高度/宽度约束? - How to add a height/width constraint with iOS Designer in Xamarin Studio? 从命令行构建Xamarin.IOS Visual Studio解决方案 - Building Xamarin.IOS Visual studio solution from command line 在 Visual Studio Windows 错误中签署 Xamarin.iOS 证书 - Signing Xamarin.iOS Certificate in Visual Studio Windows Error 从Visual Studio 2013运行xamarin.ios应用程序? - run xamarin.ios App from visual studio 2013? Xamarin.iOS 在 Visual Studio 2019、2022 中找不到配置文件 - Xamarin.iOS not found provision profiles in Visual Studio 2019, 2022
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM