这是我在 .m 文件上的代码
当我旋转方向时,它会等待大约 7-8 秒并给出 wait_fences: failed to receive reply: 10004003 error
我做错了什么谁能告诉我?
我有 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;
}