当前位置: 首页 > 工具软件 > Facebook Pop > 使用案例 >

facebook pop

商绍元
2023-12-01
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"+" style:UIBarButtonItemStyleDone target:self action:@selector(showPop)];

- (void)showPop{

if (_isOpened) {
[self hidePop];
return;
}
_isOpened = YES;

POPSpringAnimation *positionAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewFrame];
positionAnimation.fromValue = [NSValue valueWithCGRect:_hidePosition];
positionAnimation.toValue = [NSValue valueWithCGRect:_showPosition];
positionAnimation.springBounciness = 15.0f;
positionAnimation.springSpeed = 20.0f;
[_popView pop_addAnimation:positionAnimation forKey:@"frameAnimation"];
}

- (void)hidePop{

POPBasicAnimation *positionAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewFrame];
positionAnimation.fromValue = [NSValue valueWithCGRect:_showPosition];
positionAnimation.toValue = [NSValue valueWithCGRect:_hidePosition];
//key一样就会用后面的动画覆盖之前的
[_popView pop_addAnimation:positionAnimation forKey:@"frameAnimation"];

_isOpened = NO;
}
代码实现了一个边角弹出菜单效果

 类似资料:

相关阅读

相关文章

相关问答