开发者

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

开发者 https://www.devze.com 2023-02-01 11:52 出处:网络
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 d

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

精彩评论

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