UIViewController与背景图像 [英] UIViewController with background image

查看:154
本文介绍了UIViewController与背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将来自资源的图像作为背景图像插入到我的UIViewController中?
提前感谢!

How can I insert into my UIViewController an image from the resources as background image? thanks in advance!

推荐答案

添加 UIViewController ' s视图,有点像这样:

Add it UIViewController's view, somewhat like this:

- (void) viewDidLoad 
{
   UIImage *background = [UIImage imageNamed: @"background.png"];    
   UIImageView *imageView = [[UIImageView alloc] initWithImage: background]; 

   [self.view addSubview: imageView]; 

   [imageView release];

   [super viewDidLoad];
}

这篇关于UIViewController与背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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