2011-09-27 3 views
0

내 UITabbar의 아래쪽 절반이 응답하지 않습니다. 문제가있는 사람이 더 많았지 만 해결 방법은 없습니다.내 UITabbar의 절반이 작동하지 않습니다.

나는이 문제가 전체 화면 응용 프로그램에 대해 tabbar를 사용하지 않고 화면 (320 * 380 iPhone)의 일부만으로 인해 발생할 수 있다고 생각합니다. 그러나 저는 사용자 정의 UITabbarController를 사용하고 있습니다. 이것은 내 UITabBarController가 서브 클래스의 생성자 이후 :

-(void)addCustomElements 
{ 
    UIImageView *tabBarBackground = [[UIImageView alloc] initWithFrame:CGRectMake(0, 306, 320, 74)]; 
    [tabBarBackground setImage:[UIImage imageNamed:@"Tab Bottom.png"]]; 
    [self.view addSubview:tabBarBackground]; 

    UIImage *buttonImage = [UIImage imageNamed:@"Places Tab.png"]; 
    UIImage *selectedImage = [UIImage imageNamed:@"Places Tab Selected.png"]; 

    btn1 = [UIButton buttonWithType:UIButtonTypeCustom]; 
    btn1.frame = CGRectMake(0, self.view.frame.size.height-42, 160, 44); 
    [btn1 setImage:buttonImage forState:UIControlStateNormal]; 
    [btn1 setImage:selectedImage forState:UIControlStateSelected]; 
    [btn1 setTag:0]; 
    [btn1 setSelected:YES]; 

    buttonImage = [UIImage imageNamed:@"Map Tab.png"]; 
    selectedImage = [UIImage imageNamed:@"Map Tab Selected.png"]; 
    btn2 = [UIButton buttonWithType:UIButtonTypeCustom]; 
    btn2.frame = CGRectMake(160, self.view.frame.size.height-42, 160, 44); 
    [btn2 setImage:buttonImage forState:UIControlStateNormal]; 
    [btn2 setImage:selectedImage forState:UIControlStateSelected]; 
    [btn2 setTag:1]; 

    [self.view addSubview:btn1]; 
    [self.view addSubview:btn2]; 

    [btn1 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; 
    [btn2 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];  
    } 

그리고 나는이처럼 만들 :

는 는
tabBarController = [[CustomTabbar alloc]init]; 
     tabBarController.view.frame=CGRectMake(0, 0, 320, 380); 
     [tabBarController viewDidAppear:NO]; 
     mapsView = [[MapView alloc]init]; 
     placesView = [[FavoritesList alloc]init]; 
      //Suggestions from another forum (didn't work): 
     //[mapsView setWantsFullScreenLayout:YES]; 
     //[placesView setWantsFullScreenLayout:YES]; 

     [email protected]"Maps"; 
     [email protected]"Places"; 

     placesView.mapView=mapsView; 
     mapsView.favorites=placesView; 

     NSArray *controllers = [NSArray arrayWithObjects:placesView, mapsView, nil]; 
     [tabBarController setViewControllers:controllers]; 

     [self addSubview:tabBarController.view]; 

사람은 그에 대한 수정을 알고 있나요?

+1

이 문제를 디버깅하려면 tabBar.clipsToBounds = YES로 설정해보십시오. –

+0

vc의 뷰를 clipsToBounds = YES로 설정했지만 도움이되지 않았습니다. –

+0

상위보기의 크기는 얼마입니까? 최소 380 개가 아닌 경우 일부 탭은 거부됩니다. – AndrewS

답변

관련 문제