2015-05-13 2 views
-1

Я работаю на UITabBarController используя xib не раскадровку.UITabBarItem Рамка изменена?

В iPhone UITabBarItem кадр правильно и выберите пункт успешно, но когда мы запустим приложение на IPad затем UITabBar просмотр кадров iPhone UITabBar кадр, и я изменение UITabBar кадра, но и выбор UITabBarItem не установлен.
Как мы можем изменить UITabBarItem.

+0

нужно увидеть что-то больше (код, изображения и т.д.) не ясно, о чем вы спрашиваете. –

ответ

0

Проверьте мой панель вкладок код

`self.window = [[UIWindow Alloc] initWithFrame: [[UIScreen В начало] границы]]; // Переопределить точку для настройки после запуска приложения. self.viewController = [[ViewController alloc] initWithNibName: @ "ViewController ~ ipad" bundle: nil]; _NavController = [[UINavigationController alloc] initWithRootViewController: self.viewController]; tabBar = [[UITabBarController alloc] init];

[[UITabBar appearance] setSelectionIndicatorImage:[[UIImage alloc] init]]; 
    console=[[ConsoleViewController alloc] initWithNibName:@"ConsoleViewController~ipad" bundle:nil]; 
    // [email protected]"Start"; 
    tagViewObj=[[TagsViewViewController alloc] initWithNibName:@"TagsViewViewController~ipad" bundle:nil]; 
    //[email protected]"Tags"; 
    SettingsObj=[[SettingsViewController alloc] initWithNibName:@"SettingsViewController~ipad" bundle:nil]; 

UINavigationController *Navcontroller1=[[UINavigationController alloc] initWithRootViewController:console]; 
UINavigationController *Navcontroller2=[[UINavigationController alloc] initWithRootViewController:tagViewObj]; 
UINavigationController *Navcontroller3=[[UINavigationController alloc] initWithRootViewController:SettingsObj]; 

tabBar.viewControllers=[NSArray arrayWithObjects:Navcontroller1,Navcontroller2,Navcontroller3, nil];` 

смотрите изображение http://i.stack.imgur.com/faAdD.png

0

UITabBar Используйте свойство itemWidth

self.tabBar.itemWidth = [UIScreen mainScreen].bounds.size.width/self.viewControllers.count; 

@property(nonatomic) CGFloat itemWidth NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR; 
Смежные вопросы