开发者

Rows more narrow than the UITableView itself

How can I create a UITableView with grouped style such that the cells are a different width than the table view is?

For instance, the table view is width 768 (iPad width) but I want the 开发者_运维知识库cells to be only 500 wide.


What middaparka said in his comment, with the parent view the same background color as the uitableview:

myTableView.superview.backgroundColor = myTableView.backgroundColor;
// Not tested, should work though.


I'd simply create a UITableView that was 500 wide but had a transparent background. You could then put whatever background you want behind that in a UIImageView, etc.

Something like...

[myTableView setBackgroundColor:[UIColor clearColor]];
[myTableView setBackgroundView:nil];
[myTableView setOpaque:NO];

...should hopefully do the trick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜