zoukankan      html  css  js  c++  java
  • IOS 弹出菜单的动态效果

    效果1.点击按钮上浮

          2.点击按钮下沉

          3.点击按钮下拉展示

          4.点击按钮向上收缩

          5.左右如是说

    关键是改变视图的大小位置的时机正确与否

    eg1.1.点击按钮下沉消失

    已知myView.frame=cgrectmake(0,phoneHeight,320,200);

    [UIView animateWithDuration:0.8f animations:^{
               myView.frame=CGRectMake(0,Phone_Height,320,0);
            } completion:^(BOOL finished)
             {
                 [ myView removeFromSuperview];
    
             }];

    eg1.2点击按钮上浮展示

    已知按钮 myView.frame=CGRectMake(0,Phone_Height,320,0);

    [UIView animateWithDuration:0.8f animations:^{
               myView.frame=CGRectMake(0,Phone_Height,320,200);
               [self.view addSubView:myView];
            } completion:^(BOOL finished)
             {
             }];

    eg1.3点击按钮下拉展示

    已知 myView.frame=CGRectMake(0,0 , Phone_Weight, 0);

    [UIView animateWithDuration:0.8f animations:^{
                myView.frame=CGRectMake(0, moment_status+44, Phone_Weight,200);
     
            } completion:^(BOOL finished)
             {
             }];

    eg1.3点击按钮向上收缩

    已知 myView.frame=CGRectMake(0,moment_status+44, Phone_Weight, 200);

    [UIView animateWithDuration:0.8f animations:^{
                myView.frame=CGRectMake(0, moment_status+44, Phone_Weight,combox_height);
            } completion:^(BOOL finished)
             {
                 myView.frame=CGRectMake(0, moment_status+44, Phone_Weight,0);
                  
             }];

    //以上是简单操作使用,可能还需要 addSubView操作或者 removeFromeSuperView  在实践中动态操作

  • 相关阅读:
    恢复更新
    Sun与Google结为战略合作伙伴, 可能联合Sun推出Web Office
    Outlook数据文件备份和按年存档的办法
    新装的几个软件试用体会(WPS 2005,Opera,QQ 2005 Beta3)
    关于VBA和Excel,GIS软件
    人格测试
    Taking a serious look at grids
    iPod、iMac 5、iTunes 6
    如此“自助”
    UCGIS优先研究领域介绍
  • 原文地址:https://www.cnblogs.com/someonelikeyou/p/3919417.html
Copyright © 2011-2022 走看看