大佬教程收集整理的这篇文章主要介绍了ios – Path 2.0菜单动画xcode,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但我想让这些按钮直线扩展/折叠.
这是代码
ExpandableNavigation.m:
- (void) expand { transition = YES; [UIView animateWithDuration:self.speed animations:^{ self.mainButton.transform = CGAffineTransformMakeRotation( 45.0 * M_PI/180 ); }]; for (UIView* view in self.menuItems) { int index = [self.menuItems indexOfObject:view]; CGFloat oneOverCount = self.menuItems.count + 50<=1?1.0:(1.0/(self.menuItems.count-1)); CGFloat indexOverCount = index *oneOverCount; CGFloat rad =(1.0 - indexOverCount) * 90.0 * M_PI/180; CGAffineTransform rotation = CGAffineTransformMakeRotation( rad ) ; CGFloat x = (self.radius + self.bounce * self.radius ) * rotation.a; CGFloat y = (self.radius + self.bounce * self.radius ) * rotation.c; CGPoint center = CGPointMake( view.center.x + x,view.center.y + y);
- (void) expand { transition = YES; [UIView animateWithDuration:self.speed animations:^{ self.mainButton.transform = CGAffineTransformMakeRotation( 45.0 * M_PI/180 ); }]; for (UIView* view in self.menuItems) { int index = [self.menuItems indexOfObject:view]; CGFloat oneOverCount = self.menuItems.count + 50<=1?1.0:(1.0/(self.menuItems.count-1)); CGFloat indexOverCount = index *oneOverCount; CGFloat rad =(1.0 - indexOverCount) * 90.0 * M_PI/180; CGAffineTransform rotation = CGAffineTransformMakeRotation( rad ) ; CGFloat x = yourDesired_X; //should be same for all menu items CGFloat y = (view.frame.size.hieght+8.0)*index; //Y should be increasing or decreasing for every item CGPoint center = CGPointMake(x,y);
以上是大佬教程为你收集整理的ios – Path 2.0菜单动画xcode全部内容,希望文章能够帮你解决ios – Path 2.0菜单动画xcode所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。