ios 图片居中裁剪,使用居中图像iOS启动屏幕故事板

1 - I want to use a LaunchScreen.storyboard in my app

2 - In this launch screen I need to insert a brand image in center of the screen

Could anyone help me?

解决方案

I got it!

1 - Set launch file in tab > General

2 - Select LaunchScreen.storyboard in Project navigator, check the option "Use as Launch Screen" in file Inspector

3 - Drag and drop an ImageView inside the Views Controller Scene

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

Click "Add 2 constraints" button

5 - With ImageView selected, change position to centralize it.

First, check the box and after change the size value

Click "Add 2 constraints" button

6 - It is almost done!!!

Now let's resolve Auto Layout Issues, click the button "Resolve Auto Layout Issues" and update frames

7 - It's time to pick out our image

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 - So, CMD+R to build and run your app. Voilá!!!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值