ios之旋转式移动按钮
2013-02-19 11:34
232 查看
在.m 打开
1、
shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation并修改
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
2、- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { //此方法在旋转开始之后,最后的旋转动画发生之前自动调用
if (interfaceOrientation == UIInterfaceOrientationPortrait )
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(175, 20, 125, 125);
button3.frame = CGRectMake(20, 168, 125, 125);
button4.frame = CGRectMake(175, 168, 125, 125);
button5.frame = CGRectMake(20, 315, 125, 125);
button6.frame = CGRectMake(175, 315, 125, 125);
}
else
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(20, 155, 125, 125);
button3.frame = CGRectMake(177, 20, 125, 125);
button4.frame = CGRectMake(177, 155, 125, 125);
button5.frame = CGRectMake(328, 20, 125, 125);
button6.frame = CGRectMake(328, 155, 125, 125);
}
}
1、
shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation并修改
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
2、- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { //此方法在旋转开始之后,最后的旋转动画发生之前自动调用
if (interfaceOrientation == UIInterfaceOrientationPortrait )
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(175, 20, 125, 125);
button3.frame = CGRectMake(20, 168, 125, 125);
button4.frame = CGRectMake(175, 168, 125, 125);
button5.frame = CGRectMake(20, 315, 125, 125);
button6.frame = CGRectMake(175, 315, 125, 125);
}
else
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(20, 155, 125, 125);
button3.frame = CGRectMake(177, 20, 125, 125);
button4.frame = CGRectMake(177, 155, 125, 125);
button5.frame = CGRectMake(328, 20, 125, 125);
button6.frame = CGRectMake(328, 155, 125, 125);
}
}
相关文章推荐
- IOS-触摸简单应用-触摸移动按钮
- iOS小效果(0)按钮控制图片的移动的方向
- iOS 【UIKit-按钮移动操作】
- iOS移动中按钮添加点击事件
- 猫猫学IOS(二)UI之按钮操作 点击变换 移动 放大缩小 旋转
- iOS实现一个可以在屏幕中自由移动的按钮
- 猫猫学IOS(二)UI之按钮操作 点击变换 移动 放大缩小 旋转
- AJ学IOS(02)UI之按钮操作 点击变换 移动 放大缩小 旋转
- IOS-触摸简单应用-触摸移动按钮
- iOS移动中按钮添加点击事件
- [iOS开发项目-3] 按钮控件的移动,放大缩小,左右旋转操作
- IOS开发笔记-01按钮操作-13.上下左右移动 14.代码优化
- ios移动开发需要考虑的问题
- 【iOS】按钮点击弹窗
- android仿IOS按钮点击效果,一张图片实现
- IOS开发UISearchBar失去第一响应者身份后,取消按钮不执行点击事件的问题
- iOS创建不带nib文件的工程之四--在自定义view上添加按钮
- iOS_2_按钮控制物体形变
- 移动开发 IOS 一些资料和技巧
- IOS-按钮风格style(plain、bordered、done)辨析