iPhone屏幕旋转的例子
2010-11-05 00:53:50 来源:WEB开发网// Custom initialization
}
return self;
}
*/
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
{
if (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) {
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);
}
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
- ››iPhone应用帮助残障儿童看图说话
- ››iPhone实用工具AppBox Pro使用教程大揭秘
- ››iphone4省电方法
- ››iphone 获取地址的详细信息
- ››iPhone 库的基本内存管理策略
- ››iPhone加密文字亲手做 私密信息有保障
- ››iphone 根据经纬度坐标取详细地址(包括国,省,市...
- ››iphone/ipad ios cocoa object-c 近期苹果UI部分小...
- ››iphone中如何进行多线程编程
- ››iPhone OS SDK的这些事[安装、下载、版本、实例、...
- ››iPhone ObjectC的NSAutoreleasePool
- ››iPhone 判断设备是在Portrait(纵向)还是(Landscap...
赞助商链接