Ich verwende Tab-Tab-Controller mit mehr als 5 Registerkarten-Elemente mit Farbe als grün (dh angepasst) in meiner Anwendung. Wie wir wissen, werden die 5., 6. .. Tab-Elemente automatisch von MoreViewController behandelt. Meine Frage ist 1) Wenn ich den Tab Mehr Artikel auswähle, blaue Farbe Artikel, die ich bekommen habe. 2) Wenn ich von mehr Tabbar Element in vorherige umstellen, habe ich auch die Artikelfarbe als blau. Also, wie die Tabbar-Elemente in beiden Fällen als grün zu machen?Wie kann die Farbe der Tabellendarstellung anders als standardmäßig blau eingestellt werden, wenn mehr als 5 Registerkartenelemente vorhanden sind?
0
A
Antwort
0
In Apple-Dokumentation gibt es dafür keine Lösung. Ich endete mit meiner eigenen gefälschten Tabbar mit benutzerdefinierten Schaltflächen.
0
buddy you have 2 choices
1. u take 2 image for every tabbar 1st disable tile 2nd show enable time
self.window.backgroundColor =[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]]; //[UIColor blackColor];
tabBarController = [[UITabBarController alloc] init];
[tabBarController setDelegate: self];
// [tabBarController.tabBar setDelegate:self];
//tabBarController = [[UITabBarController alloc] init];
tabBarController.tabBar.tintColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]];
//tabBarController.tabBarItem.title=[UIColor whiteColor];
//[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
//[[UITabBar appearance] setBackgroundColor:[UIColor whiteColor]];
//tabBarController.tabBar.backgroundColor = [UIColor whiteColor];
NSMutableArray *localViewControllersArray = [[NSMutableArray alloc] initWithCapacity:7];
Login *home = [[Login alloc] initWithNibName:@"Login" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:home];
//localNavController.tabBarItem.image = [UIImage imageNamed:@"Central.png"];
[email protected]"Central";
[localViewControllersArray addObject:localNavController];
PuckDisplay *puck=[[PuckDisplay alloc]initWithNibName:@"Display" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:uck];
//localNavController.tabBarItem.image = [UIImage imageNamed:@"Display.png"];
[email protected]" Display";
[localViewControllersArray addObject:localNavController];
PhotoBooth *photo=[[PhotoBooth alloc]initWithNibName:@"Booth" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:photo];
//localNavController.tabBarItem.image = [UIImage imageNamed:@"Booth.png"];
[email protected]"Booth";
[localViewControllersArray addObject:localNavController];
More *more=[[More alloc]initWithNibName:@"More" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:more];
//localNavController.tabBarItem.image = [UIImage imageNamed:@"home.png"];
[email protected]"More";
[localViewControllersArray addObject:localNavController];
tabBarController.viewControllers = localViewControllersArray;
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor grayColor], UITextAttributeTextColor,
[UIColor grayColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Helvetica" size:0.0], UITextAttributeFont, nil]
forState:UIControlStateNormal];
UITabBarItem *tabBarItem1 = [[self.tabBarController.tabBar items] objectAtIndex:0];
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"CentralA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"Central.png"]];
UITabBarItem *tabBarItem2 = [[self.tabBarController.tabBar items] objectAtIndex:1];
[tabBarItem2 setFinishedSelectedImage:[UIImage imageNamed:@"DisplayA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"Display.png"]];
UITabBarItem *tabBarItem3 = [[self.tabBarController.tabBar items] objectAtIndex:2];
[tabBarItem3 setFinishedSelectedImage:[UIImage imageNamed:@"BoothA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"Booth.png"]];
UITabBarItem *tabBarItem4 = [[self.tabBarController.tabBar items] objectAtIndex:3];
[tabBarItem4 setFinishedSelectedImage:[UIImage imageNamed:@"moreA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"more.png"]];
2. if u want only change tabbar color then change tabbar tin color
self.tabBarController.tabBar.tintColor = [UIColor colorWithRed:(157/255.0) green:(33/255.0) blue:(33/255.0) alpha:1];
Verwandte Themen
- 1. Registerkartenelemente können nicht eingestellt werden
- 2. Die Tabellendarstellung sieht anders aus als nur Leerzeichen
- 3. Wie wird die Druckseitenformatierung anders als die Bildschirmseite eingestellt?
- 4. Wie kann die Hintergrundfarbe einer Zelle anders als die offensichtliche Zellenschattierungseigenschaft festgelegt werden?
- 5. Sprache der Registerkartenelemente ändern
- 6. Intellij - wenn die Ordnerstruktur ist anders als die Paketnamen
- 7. UITabBarContoller Option "Mehr" Farbe der oberen Leiste
- 8. REGEX, dass man, wenn mehr als eine vorhanden verlässt, ist
- 9. Mehr als 1 Farbe in geom_text()
- 10. sind Python Lambdas anders als Standardfunktionen implementiert?
- 11. Angular JS erstellen Absätze standardmäßig, wenn keine vorhanden sind
- 12. vorhanden mehr als ein modalview in AppDelegate
- 13. Sind C-Dotierungen anders als .NET-Doubles?
- 14. MKPinAnnotationView: Sind mehr als drei Farben verfügbar?
- 15. Machen Sie mehr als eine geklickte Taste Farbe ändern
- 16. Android RatingBar mit mehr als 5 Sternen
- 17. Xcode Fehler mit mehr als 5 UIImages
- 18. Wie können Zeilen mit NAs nur entfernt werden, wenn sie in mehr als einem bestimmten Prozentsatz von Spalten vorhanden sind?
- 19. Fehlermeldung nicht angezeigt, wenn Dateigröße mehr als 5 MB ist
- 20. Sind die Zusammenführungen in Git anders als in Mercurial?
- 21. Wie ignoriere ich Rückgabewert anders als 0, wenn ich -e eingestellt habe?
- 22. Benutzerdefinierte ListView anders auf Tablets als Handys
- 23. Zuordnungsfehler, wenn Jobs mehr als einmal verfügbar sind
- 24. QtConcurrent :: run() kann nicht mehr als 5 Argumente behandeln?
- 25. Fenstergröße ist anders als Modell
- 26. Wie setze ich die slotMinutes anders als das Drag-Intervall?
- 27. Wie schreibe ich die Umschreibungsbedingung für request_filename anders als angegeben
- 28. Kann PHPs ob_start mehr als einmal aufgerufen werden?
- 29. Rails 4 Rückgabetasks, die mehr als einem Benutzer zugeordnet sind
- 30. Wie kann ich Dateien, die größer als 5 GB sind, auf Amazon S3 hochladen?