Background image stretching in iPhone X

后端 未结 3 539
礼貌的吻别
礼貌的吻别 2021-01-25 22:31

Currently we are using image asset with @1x, @2x and @3x which will support for all devices. But when we use the same image asset for iPhone X, the @3x image looks stretched in

3条回答
  •  甜味超标
    2021-01-25 23:11

    An alternative is to select Aspect Fill. Then lower down in attribute inspector select Clip to Bounds. The image will fill your UIIMageView, but based on the Aspect Ratio will clip it to "remove" that part of the image that doesn't fit the view.

    The only way to avoid all of this is to have an image with an aspect ratio (width to height) that matches the aspect ratio of your UIImageView.

提交回复
热议问题