UITableViewController背景图片 [英] UITableViewController Background Image
本文介绍了UITableViewController背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为UITableViewController
设置图像?
我已经使用了很多东西,但是将图像设置为背景并没有帮助
I have used many things but it doesn't help me to set the image as background
UIImageView* bgView = [[[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"Default.png"]] autorelease];
[tableView.backgroundView addSubview:bgView];
还有这个
[[self view] setAutoresizesSubviews:NO];
UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame];
backgroundView.backgroundColor =
[UIColor colorWithPatternImage:
[UIImage imageNamed:@"Default.png"]];
self.tableView.backgroundView = backgroundView;
self.tableView.backgroundColor = [UIColor clearColor];
[backgroundView release];
和
self.navigationController.view.backgroundColor =
[UIColor colorWithPatternImage:
[UIImage imageNamed:@"myImage.png"]];
self.tableView.backgroundColor = [UIColor clearColor];
没有一个对我有用.
推荐答案
设置background
填充模式
[youTable setBackgroundView:
[[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"bg.png"]]];
设置background
模式图块
[youTable setBackgroundColor:
[UIColor colorWithPatternImage:
[UIImage imageNamed:@"bg.png"]]];
这篇关于UITableViewController背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文