开发者

How To Draw A Line Dividing The Cell's Accessory View

I just wanted to know how I could draw a line dividing the cell's accessory view f开发者_JAVA技巧rom the rest of the cell.


You could simply add a thin UIView (or UIImageView if you wanted a fancier divider) like so.

UIView *divider = [[UIView alloc] initWithFrame:CGRectMake(290, 3, 1, 38)];
[divider setBackgroundColor:[UIColor blackColor]];
[cell.contentView addSubview:divider];
[divider release];

If you're using one of UITableView's default accessory views, your content view will be squashed to make room for the accessory, so you your x-coordinate may have to change to sit at the very edge of the content view.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜