开发者

Build a custom share panel of buttons

I am trying to build a custom share panel with buttons.

  • This is how it appears before being clicked.

Build a custom share panel of buttons

I know that may be complicated, but I need the steps to accomplish this.

The images show the mock-ups of the panel.


You just think complicated. It is not complicated; all you need is a view on the main window with this arrow custom button, when click it just move it from bottom to top.


I found the solution.

  • Create the user interface.

    Build a custom share panel of buttons

  • Link the user interface with IBoutlets and IBActions.

  • Animate the UIView item with buttons.

    -(IBAction) openPanelBtnPressed:(id)sender{
    CGPoint wpos = self.panel.frame.origin ;
    if(wpos.x == 0 && wpos.y ==133){
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:1];
        [UIView setAnimationBeginsFromCurrentState:YES];
        self.panel.frame=CGRectMake(0.0,330, 76, 368);
        self.panel.transform = CGAffineTransformIdentity;  
        [UIView commitAnimations];
    UIImage * imgOpenPanelBtn = [UIImage imageNamed:@"up.png"];
    [self.btnOpenPanel setImage:imgOpenPanelBtn forState:UIControlStateNormal];
    
     }else {
            [UIView beginAnimations:nil context:nil];
            [UIView setAnimationDuration:1];
            [UIView setAnimationBeginsFromCurrentState:YES];
            self.panel.frame=CGRectMake(0.0, 133.0, 76, 368);
             self.panel.transform = CGAffineTransformIdentity;  
            [UIView commitAnimations];
            UIImage * imgOpenPanelBtn = [UIImage imageNamed:@"down.png"];
            [self.btnOpenPanel setImage:imgOpenPanelBtn forState:UIControlStateNormal];
    
     }
     }
    
  • The result is this one: http://www.youtube.com/watch?v=6zoZKjbZAps.

  • You can find the explanation in Arabic on my blog.

  • You can download the project.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜