Experience-custom tabbar (inherited from UITabBar)
Generally, a custom tabbar can be inherited from the UITabBar of the system or the tabbar of the UIView. Now let's take a look at some details that need to be paid attention to in the inheritance and UITabBar situations. In fact, inheritance and UITabBar are nothing more than modifying the frame of the Child control in tabbar or adding a child control. Next, add a button to the custom tabbar.
Note: first, let's print out the child controls in UITabBar:
We can see that two controls except UITabBarButton are printed: UITabBarBackgroundView and UIImageView. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCrTTs9 + 0587Sw8e + zcTcutzD98/UtcS/hybrid + zcrHyc/D5rXExMfSu7j5z9 + hybrid/hybrid + fill "brush: java;"> For (UIView * child in self. subviews) {Class class = NSClassFromString (@ "UITabBarButton"); if ([child isKindOfClass: class]) {// sets the frame code }}
Because the UITabBarButton is private, we can use the above method to determine, and then set our frame to remove the interference of the two controls.