Build a custom share panel of buttons

十年热恋 提交于 2019-12-08 12:39:40

问题


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

  • This is how it appears before being clicked.

  • This is how it appears after.

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

The images show the mock-ups of the panel.


回答1:


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.




回答2:


I found the solution.

  • Create the user interface.

  • 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.


来源:https://stackoverflow.com/questions/7475447/build-a-custom-share-panel-of-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!