iOS Tabbar Item Title Issue in iOS13

UITabBarItem Title Text Not Align Centrally, When We Set Device in Landscape Mode in iOS13

I found the solution of this problem, you want to add one method into your viewController.m file which have a TabBar.

If your application supporting dark mode then you need to add this method, it will work for all iOS device

    -(UITraitCollection *)traitCollection {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return [super traitCollection];
}else{
UITraitCollection *superSizeClass = [super traitCollection];
UITraitCollection *verticalSizeClass = [UITraitCollection traitCollectionWithVerticalSizeClass:UIUserInterfaceSizeClassRegular];

NSArray *combinedTraitArray = [NSArray arrayWithObjects: superSizeClass,verticalSizeClass, nil];

UITraitCollection *combinedTraits = [UITraitCollection traitCollectionWithTraitsFromCollections: combinedTraitArray];
return combinedTraits;
}
}

It will work for this issue. Thanks.

UITabBarItem icon not colored correctly for iOS 13 when a bar tint color is specified in Interface Builder in Xcode 11, beta 2

On the surface, this might seem like a bug, however you can mitigate it by defining an .unselectedItemTintColor on your UITabBar instance.

self.tabBar.unselectedItemTintColor = [UIColor lightGrayColor];

UITabBar transparent labels bug in iOS 13

Well, this is due to the behavior in the default dark mode on iOS 13.

To achieve what you wanted with labels as on iOS versions below 13,

Simply add this into your Info.plist:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

What this essentially does is changing the global user interface style to the light style which is the default style on iOS versions below 13.

If you won't prefer to change the user interface style, you can also change the tint color of the unselected items on the tab bar:

tabBar.unselectedItemTintColor = .darkGray

or to any other tint color of your choice.



Related Topics



Leave a reply



Submit