i am setting a background image to the selected item of tab bar.
UIImage* tabBarBGImage = [UIImage imageNamed:@"bg_image"];
[tabBar setSelectionIndicatorImage:tabBarBGImage];
But the background image comes outside of tabbar. How can we set the content mode ?
Some answers on stack overflow suggest image resizing, is that the only solution?
Try to set clipsToBounds and avoid autoresizing of sub views
tabBar.autoresizesSubviews = NO;
tabBar.clipsToBounds = YES;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.