(ios)如何使用动画添加子视图

时间:2016-05-19 12:12:19

标签: ios xib caanimation

子视图在xib文件中创建,高度为390

    ITTalentShowAdvancePopUpView * view=[[[NSBundle mainBundle] loadNibNamed:@"ITTalentShowAdvancePopUpView" owner:nil options:nil] lastObject];
  //here set the frame height but not working
    view.frame=CGRectMake(0,114,SCREEN_WIDTH,0);
    _advanceMaskPopUpMaskView.advancePopUpView=view;
   [_advanceMaskPopUpMaskView addSubview:view];
    [UIView  animateWithDuration:0.3 animations:^{
            [view setHeight:390];
            [_advanceMaskPopUpMaskView layoutSubviews];
        }];

子视图直接出现没有动画,请告诉我原因,非常感谢

0 个答案:

没有答案