构建按键的自定义面板的份额 [英] Build a custom share panel of buttons

查看:141
本文介绍了构建按键的自定义面板的份额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立与按键的自定义份额面板。

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


  • 这是它被点击之前的显示方式。


  • 这是怎么回事后出现。

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

推荐答案

我找到了解决办法。


  • 创建用户界面。

  • Create the user interface.

关联的用户界面IBoutlets和IBActions。

Link the user interface with IBoutlets and IBActions.

与按钮动画UIView的项目。

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];

 }
 }


  • 结果是这样的: http://www.youtube.com/watch ?v = 6zoZKjbZAps

    您可以找到我的博客在阿拉伯语中的解释。

    You can find the explanation in Arabic on my blog.

    这篇关于构建按键的自定义面板的份额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆