Drawing a very thin line on UIView

Samuli Lehtonen

So I got UIView at the top of my app and I want to draw a thin line at the bottom of it, a very similar line that act as a seperator in UITableView. I currently have a UIView that has height of 1px set in IB, but when I compare that line to the seperator in UITableView it has higher height. Is there any good way to draw a thin line inside a UIView?

Marc

Give the frame of your line view a height (or width) of 0.5 and set the backgroundColor to [UIColor lightGrayColor].

Edit: For non-retina you might change the height/width to (1.0 / [UIScreen mainScreen].scale)

This will result in 0.5 on retina and 1.0 on non-retina displays.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related