问题描述
1 - 我想在我的应用中使用LaunchScreen.storyboard
1 - I want to use a LaunchScreen.storyboard in my app
2 - 在此启动屏幕中,我需要在屏幕中央插入品牌形象
2 - In this launch screen I need to insert a brand image in center of the screen
任何人都可以帮助我吗?
Could anyone help me?
推荐答案
我知道了!
1 - 在标签中设置启动文件>常规
1 - Set launch file in tab > General
2 - 在Project导航器中选择LaunchScreen.storyboard,选中文件Inspector中的Use as Launch Screen选项
2 - Select LaunchScreen.storyboard in Project navigator, check the option "Use as Launch Screen" in file Inspector
3 - 在View Controller场景中拖放ImageView
3 - Drag and drop an ImageView inside the Views Controller Scene
4 - 选择之前添加的ImageView,更改其宽度和高度。我把wxh 200
4 - Select the ImageView added before, change its width and height. I put w x h 200
首先,勾选方框并在更改尺寸值后
First, check the box and after change the size value
点击添加2个约束 按钮
Click "Add 2 constraints" button
5 - 选择ImageView后,更改位置以集中它。
5 - With ImageView selected, change position to centralize it.
首先,选中复选框,更改大小值后
First, check the box and after change the size value
点击添加2个约束按钮
6 - 差不多完成!! !
6 - It is almost done!!!
现在让我们解决自动布局问题,点击解决自动布局问题按钮并更新框架
Now let's resolve Auto Layout Issues, click the button "Resolve Auto Layout Issues" and update frames
7 - 是时候选择我们的图像了
7 - It's time to pick out our image
选择ImageView后,转到> Atributes Inspector选项卡并选择你想要的图像,remenber删除它的扩展名(这是诀窍) ,因为在真实设备上构建应用程序时可能会出现图像,发生在我身上!!!)。
With ImageView selected go to > Atributes Inspector tab and choose the image u want, remenber to remove its extension (it is the trick, because the image may note appear when building the app on real device, happened with me!!!).
8 - 所以,CMD + R来构建和运行你的应用程序。 Voilá!!!!!
8 - So, CMD+R to build and run your app. Voilá!!!!!
这篇关于使用居中图像iOS启动屏幕故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!