这是我在.m文件中的代码
当我旋转方向时,它等待大约7-8秒并给出wait_fences:未能收到回复:10004003错误
我有什么不对的人能告诉我的?
当方向改变时,我有3个按钮和一个背景图像,视图将改变 所以我这样做了,但效果很慢
- (void)viewDidAppear:(BOOL)animated
{
[[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
self.navigationController.navigationBar.hidden=YES;
UITabBarController *aaa = self.tabBarController;
NSUserDefaults *data2 = [NSUserDefaults standardUserDefaults];
if([[data2 valueForKey:@"setValue"] isEqualToString:@"tr"])
{
UITabBarItem *tabItem1 = [[[aaa tabBar]items]objectAtIndex:0];
tabItem1.title=@"Ana Ekran";
UITabBarItem *tabItem2 = [[[aaa tabBar]items]objectAtIndex:1];
tabItem2.title=@"Mağazalar";
UITabBarItem *tabItem3 = [[[aaa tabBar]items]objectAtIndex:2];
tabItem3.title=@"Kampanyalar";
UITabBarItem *tabItem4 = [[[aaa tabBar]items]objectAtIndex:3];
tabItem4.title=@"Hesabım";
UITabBarItem *tabItem5 = [[[aaa tabBar]items]objectAtIndex:4];
tabItem5.title=@"İletişim";
}
else {
UITabBarItem *tabItem1 = [[[aaa tabBar]items]objectAtIndex:0];
tabItem1.title=@"Home";
UITabBarItem *tabItem2 = [[[aaa tabBar]items]objectAtIndex:1];
tabItem2.title=@"Stores";
UITabBarItem *tabItem3 = [[[aaa tabBar]items]objectAtIndex:2];
tabItem3.title=@"Promotions";
UITabBarItem *tabItem4 = [[[aaa tabBar]items]objectAtIndex:3];
tabItem4.title=@"Account";
UITabBarItem *tabItem5 = [[[aaa tabBar]items]objectAtIndex:4];
tabItem5.title=@"Contact";
}
self.view.backgroundColor=[UIColor blackColor];
[super viewDidAppear:NO];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewDidUnload
{
[self setImgblacktie:nil];
[self setImgsarar:nil];
[self setImginterview:nil];
[self setImgbackground:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (fromInterfaceOrientation==UIInterfaceOrientationPortrait || fromInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"yatay1");
imgbackground.frame=CGRectMake(0, -256, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(303, 44, 444, 173);
imgsarar.frame=CGRectMake(303, 238, 444, 173);
imginterview.frame=CGRectMake(303, 432, 444, 173);
}
else if(fromInterfaceOrientation==UIInterfaceOrientationLandscapeRight || fromInterfaceOrientation==UIInterfaceOrientationLandscapeLeft)
{
NSLog(@"dikey1");
imgbackground.frame=CGRectMake(-128, 0, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(168, 193, 444, 173);
imgsarar.frame=CGRectMake(168, 388, 444, 173);
imginterview.frame=CGRectMake(168, 583, 444, 173);
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationPortrait){
imgbackground.frame=CGRectMake(-128, 0, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(168, 193, 444, 173);
imgsarar.frame=CGRectMake(168, 388, 444, 173);
imginterview.frame=CGRectMake(168, 583, 444, 173);
}
else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
imgbackground.frame=CGRectMake(0, -256, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(303, 44, 444, 173);
imgsarar.frame=CGRectMake(303, 238, 444, 173);
imginterview.frame=CGRectMake(303, 432, 444, 173);
}
else if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
imgbackground.frame=CGRectMake(0, -256, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(303, 44, 444, 173);
imgsarar.frame=CGRectMake(303, 238, 444, 173);
imginterview.frame=CGRectMake(303, 432, 444, 173);
}
else if(interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown){
imgbackground.frame=CGRectMake(-128, 0, 1024, 1024);
imgbackground.image=[UIImage imageNamed: @"backgroundbuyuk.png"];
imgblacktie.frame=CGRectMake(168, 193, 444, 173);
imgsarar.frame=CGRectMake(168, 388, 444, 173);
imginterview.frame=CGRectMake(168, 583, 444, 173);
}
return YES;
}