如何将背景图像添加到iOS 6中的分组样式UITableViewController? [英] How do I add a background image to a grouped style UITableViewController in iOS 6?

查看:103
本文介绍了如何将背景图像添加到iOS 6中的分组样式UITableViewController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"fullscreen-bg.png"]];
self.tableView.backgroundColor = [UIColor clearColor];

该代码在iOS 5中运行良好但在iOS 6中不起作用。在iOS 6中它只显示默认的细条纹背景。任何想法?

That code worked fine in iOS 5 but it doesn't work in iOS 6. In iOS 6 it just show the default pinstriped background. Any ideas?

推荐答案

您可以将图像添加为背景视图

You can add the image as a background view

[tableView setBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]]];

这就是它

这篇关于如何将背景图像添加到iOS 6中的分组样式UITableViewController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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