这是关于旋转的一段代码
- (void)viewDidLoad
{
[superviewDidLoad];
[self loadButton:self.view.bounds];
}
#pragma mark - Rotate
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
returnYES;
}
- (BOOL)shouldAutorotate
{
if ([[UIDevicecurrentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
return NO;
}else{
return YES;
}
}
- (NSUInteger)supportedInterfaceOrientations
{
returnUIInterfaceOrientationMaskAllButUpsideDown;
}
//屏幕旋转后调用
-(void)viewWillLayoutSubviews{
NSArray*viewArr = self.view.subviews;
for (UIView*view in viewArr) {
[view removeFromSuperview];
}
[self loadButton:self.view.bounds];
}
-(void)viewRoate:(CGRect)bounds{
// CGRect frame = [self setControllerFrame];
UIButton*button = [[UIButton alloc]initWithFrame:bounds];
[button setTitle:@"button"forState:UIControlStateNormal];
[button setBackgroundColor:[UIColorgreenColor]];
[button addTarget:nilaction:@selector(openTablecontroller) forControlEvents:UIControlEventTouchDown];
[self.view addSubview:button];
}
旋转后,子控件转动的效果感觉有点闪跳 请问该怎么解决呀???
应该很详细了 请大神们指点指点 我这个菜鸟!!!