我已经建立在Xcode 5.In纵向视图黄色按钮自定义按钮将具有显示和在横向模式下的蓝色按钮将不得不display.my代码如下:
-(BOOL)shouldAutorotate {
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait) {
[self addYellowBtn1];
}
else if(orientation == UIInterfaceOrientationLandscapeRight)
{
[self addLightBlueBtn2];
}
return YES;
}
当我运行这个程序,在第一纵向视图显示黄色button.but当我变成景观的两个按钮分别displayed.can谁能帮助我?