gpt4 book ai didi

iphone - 如何在 iPhone 5 中支持自定义图形

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:04:04 26 4
gpt4 key购买 nike

如何在 iPhone 5、4 英寸显示屏中支持自定义图形。
我知道对于 Default 它需要添加 -568h 前缀并且当我的状态栏被隐藏并且我的背景图像大小为 640 x 1136 px 时它可以工作。但是当我需要为尺寸小于 1136 像素的屏幕添加自定义背景时,它不起作用。
那么如何在新的 Retina 显示器中支持自定义图形呢?

最佳答案

你可以使用我的三个#define:

#define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define iPhone568ImageNamed(image) (isPhone568 ? [NSString stringWithFormat:@"%@-568h", image] : image)
#define iPhone568Image(image) ([UIImage imageNamed:iPhone568ImageNamed(image)])

只需为您的图像添加 -568h@2x.png 符号,并使用 iPhone568ImageNamed 获取标准名称或 iPhone 5/new iPod 的名称。

关于iphone - 如何在 iPhone 5 中支持自定义图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12516302/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com