Pro UITableView Chapter 2
往后的文章均以《Pro iOS Table Views》一书为基准,可能对于iOS7有点不适用,具体细节容我稍后再验证。
改变UITableView的背景
设置tableview的背景色为透明色。
[myTableView setBackgroundColor:[UIColor clearColor]];
使用你需要的背景图,新建一个UIImageView。
UIImageView *tableBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myImage"]];
设置该UIImageView的frame大小。
[tableBackgroundView setFrame: myTableView.frame];
最后将UIImageView替代tableview的背景图。
[myTableView setBackgroundView:tableBackgroundView];