简体   繁体   English

Xamarin - 如何集中启动屏幕图像(iOS)?

[英]Xamarin - how to center a launch screen image (iOS)?

I'm using Xamarin for Visual Studio, and am getting frustrated trying to do what I would think should be a very simple thing: creating a launch (splash) screen for iOS, that has a single image that is centered on the screen (vertically and horizontally centered). 我正在使用Xamarin进行Visual Studio,我很沮丧地尝试做我认为应该是一件非常简单的事情:为iOS创建一个启动(启动)屏幕,它有一个以屏幕为中心的图像(垂直)并水平居中)。

I'm creating it the recommended way, using a storyboard (other methods, like using an assets catalog, are considered deprecated as of iOS 9). 我正在以推荐的方式创建它,使用故事板(其他方法,如使用资产目录,从iOS 9开始被视为已弃用)。 In the storyboard, I have a View Controller, which contains a View, which contains an Image View. 在故事板中,我有一个视图控制器,其中包含一个包含图像视图的视图。 In the Properties pane, I've tried messing with the Mode (in Widget tab), and I've tried playing around with contstraints - which I think might be the key, but it is difficult to understand how it all works together. 在“属性”窗格中,我尝试弄乱模式(在“窗口小部件”选项卡中),并且我尝试过使用约束 - 我认为这可能是关键,但很难理解它是如何一起工作的。

You need to add the Splash screen in the applications properties (Launch Images). 您需要在应用程序属性(启动图像)中添加启动画面。 You need to create the image and upload it via that section. 您需要创建图像并通过该部分上传。 I couldn't find anything saying that the use of Asset catalogues are depreciated. 我找不到任何说资产目录的使用被折旧的说法。

在此输入图像描述

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

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