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  在实践中动态操作

  • 相关阅读:
    01、u-boot 打补丁 编译 烧写
    3、JZ2440 按键驱动(中断)
    2、JZ2440 按键驱动(查询)
    1、JZ2440 LED驱动
    004、栈的基本操作
    003、动态顺序表的插入与删除
    002、静态顺序表的插入与删除
    对百度的评价
    关于找水王的思路
    软件市场应用前景
  • 原文地址:https://www.cnblogs.com/someonelikeyou/p/3919417.html
Copyright © 2011-2022 走看看