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

查看:32
本文介绍了为整个 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天全站免登陆