tags:

views:

29

answers:

1

i want to pop up a circular ring whenever user press base button and that ciruclar ring should have 6 buttons on corner and each button should have its own function upon click.

but i dont know how to put those 6 buttons.

so on screen there will be 4 base button and user can click any of the 4 to pop that circular ring (with 6 buttons)

A: 

Keep the buttons separate from the ring.

The ring is just a graphical element (UIImageView) on which the six UIButton instances sit atop.

Make the ring and its buttons subviews of a parent view. Use the frame property to set their position and size.

Your first "top-most" button could have a selector that then unhides the ring and the six buttons:

- (void) unhideButtonRing:(id)sender {
    ringElement.hidden = NO;
    buttonOne.hidden = NO;
    ...
    buttonSix.hidden = NO;
}

You could use an NSTimer to hide the button-ring after some time period.

Alex Reynolds
so you want me to put mannually those buttons ... but lets say i have 4 base buttons on screen and each base button on click should display that ring ..with all 6 buttions and method ... its will be too messy to write coordinate.. plz help me i am dead :( any code or any link
ram
You could write a `UIView` subclass that draws a ring of buttons. You can then make as many rings as you want, and place them anywhere you want.
Alex Reynolds
you method is working but DO I need to write all ring coordinates???if i hve 7 rings then 7 *6coordintes??? that too manually
ram
how to draw rings of buttons??
ram
- (void)drawRect:(CGRect)rect { // Drawing code NSLog(@"just cvcvccvcvcclicked"); UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(0,0,100,100); [button setTitle:@"button" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:button]; }you mean like this i have to make 6 buttons??
ram
Yep. Or use Interface Builder.
Alex Reynolds
so you mean if i have to show 4 base button then i have to write 4*6= 24 buttons coordinates???
ram
Not if you set the button-ring frame values relative to the base buttons. When you instantiate your custom UIView, pass it the base button coordinates and draw the view relative to the base button.
Alex Reynolds
ooops i am not getting plz share one code plzzz :(
ram
do i need to draw 6 buttons on drawRect()??
ram
any one plz help :(
ram