views:

69

answers:

3

I have two labels that are stacked. If I want a horizontal line between them, is there any other way besides using an image with a UIImageView?

+4  A: 

Create a UIView with a black background that is 1 pixel high and 320 pixels wide?

Sounds like something you could do in Interface Builder in less than 30 seconds...

Jasarien
+1  A: 

You can always use a UILabel with the background color set to the color you want and the height to 1 or 2px.

Nathan S.
+3  A: 

Use a UIView:

UIView * separator = [[UIView alloc] initWithFrame:CGRectMake(x, y, 320, 1)];
separator.backgroundColor = [UIColor colorWithWhite:0.7 alpha:1];
[self.view addSubview:separator];
[separator release];
Tom Irving