views:

77

answers:

1

Hi, I need to create a rounded rectangular box in which there will be 6 buttons in iPhone application. And the rectangular box is transparent. Each button have an image and text. And they are also transparent. ( Here transparent means we can see the background image of the box. Sorry for my vocabulary.)

I could not get how to start it. I thought of the following one but,

By using core graphics draw the outside rounded rectangle and then draw inside rectangles like 2x3 grid.

Can I make with this ? Are there any good and easy methods than this. Please give me some idea how to start over with ?

I got the rounded rectangle. Now I need to draw the lines in them to divide it into 6 parts. I used link text How can I get the rectangle context to draw lines ?

Thank you.

A: 

If your needs are simple enough you can use CALayer properties.

someView.layer.cornerRadius = 10;
someView.layer.borderColor = [[UIColor redColor] CGColor];
someView.layer.backgroundColor = [[UIColor greenColor] CGColor];
someView.layer.opacity = 0.5;

opacity is equivalent to UIView alpha.

drawnonward
UIView's CALayer is read-only... this shouldn't work.
alexbw
You cannot assign a new layer to the view, but you can modify the layer of the view.
drawnonward