关于UIWindow背景的问题
我已经编写了一个功能强大的三角计算器,但我想使用“亚麻”背景。我已经能够在界面构建器中实现此功能,但我在 Xcode 中收到“黄色三角形”警告,表示它与 iOS 3.2 及更早版本等不兼容。如果这么说的话,恐怕苹果会拒绝。我想知道可以用来更改文本颜色(从黑色到白色)和背景纹理(从蓝色和白色垂直条纹到深色亚麻布)的代码。我已经知道一些测试和应用有关用户当前固件版本的信息的方法,但我始终乐于接受建议。任何帮助将不胜感激!我刚刚读了前 3 个答案,呃,我觉得有点愚蠢,这是有道理的。但我也想知道如何做到这一点,并使其像用户可配置的“设置”,只是为了让它感觉更好:-)谢谢
I have written a powerful trig calculator, but I want to use the "linen" background. I have been able to implement this in interface builder, but I get a 'yellow triangle' warning in Xcode that says it is not compatible with something like iOS 3.2 and earlier. And I'm afraid Apple will reject it if says that. I want to know the code that I can use to change both the text color (from black to white) and the background texture (from blue and white vertical stripes to the darker linen). I already know a few ways to test and apply info about the users current firmware version, but I'm always open to suggestions. Any help will be GREATLY APPRECIATED!!! I have just read the first 3 answers and duh I feel kinda stupid, that makes sense. But I would also like to know how to do this and make it like a user configurable "setting" just to make it feel nicer :-) thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
亚麻背景是平铺的 UIColor。您可以通过编程方式创建平铺颜色,并将此平铺背景应用于您要设置背景颜色的任何位置。即使在 UIWindow 上也是如此。
The linen background is a tiling UIColor. You can create a tile color programmatically and apply this tiled background anywhere you would set a backgroundColor. Even on UIWindow.
如果您想保持与旧 iOS 版本的兼容性,请将内置背景“颜色”(例如
linen
)替换为显示其图像的 UIImageView。编写一个简单的应用程序,用背景填充整个屏幕,制作屏幕截图,然后将其放置在所有其他 UI 元素后面。
If you want to maintain compatibility to old iOS versions, replace the built in background "color" (such as
linen
) with an UIImageView showing an image of it.Write a simple app, filling the entire screen with the background, make a screenshot, then place it behind all other UI elements.