为整个iPhone / iPad应用设置背景图像 [英] set background image for entire iPhone / iPad app

查看:101
本文介绍了为整个iPhone / iPad应用设置背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个我想作为我的应用程序的背景的图像,无论它们在哪个视图控制器上 - 你如何实现这个目标?

I have a single image I want as the background for my app no matter what viewcontroller they are on - how do you accomplish this?

推荐答案

以下是设置图像背景的方法:

Here's how you set a background to an image:

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];






编辑到写下Felixyz所说的内容(感谢Manni),在你的代表中这样做:


To write up what Felixyz said (and thanks to Manni), do this in your delegate:

window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];

在每个视图中,您想拥有图片,请执行以下操作:

self.view.backgroundColor = [UIColor clearColor];

这篇关于为整个iPhone / iPad应用设置背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆