ios - 如何针对所有屏幕尺寸在 Xamarin iOS 的中心对齐元素?

标签 ios xamarin xamarin.ios autolayout

我一直在尝试在所有苹果屏幕尺寸的屏幕中央保留一个 Logo ,但当 Logo 很小时它似乎不起作用。据我了解,这可能是因为左、右、上、下边距约束是绝对的而不是相对的。

enter image description here

enter image description here

更新:

enter image description here enter image description here

当我在模拟器中将 Generic 更改为 iPhone 5s 时: enter image description here ] 5

最佳答案

正如@Sami Kuhmonen 提到的,为中心添加一个约束。

enter image description here

如何添加?

将图钉(位于中心)拖到垂直和水平线上。 enter image description here

单击此按钮更新框架:

enter image description here

关于ios - 如何针对所有屏幕尺寸在 Xamarin iOS 的中心对齐元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46763459/

相关文章:

ios - 具有特殊字符的 Swift 正则表达式

android - 如何在 Android (Xamarin) 上为 AWS SNS 启用推送通知

ios - 将 UICollectionview 中单元格的移动限制在 CollectionView 的范围内

ios - 在 RxSwift 中观察其他 ViewController 中的对象变化

iphone - 将 IndexPath 传递给 subview

ios - 如何在OS X应用程序中重置内容和设置?

xamarin - 如何使 ActivityIndi​​cator 覆盖全屏?

powershell - 在安装在 Mac 上的 VSTS 代理中运行 powershell 构建步骤?

c# - 无法在 MonoTouch 中的 NavigationItem.RightBarButtonItems 中放置两个按钮

audio - 单触 : Capture Audio Stream From Microphone