这是我的代码:
if ([UIImage instancesRespondToSelector:@selector(imageWithRenderingMode:)]) { tab_01_on_image = [[UIImage imagenamed:@"Tabbar_on_01"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; tab_01_off_image = [[UIImage imagenamed:@"Tabbar_off_01"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];} else { tab_01_on_image = [UIImage imagenamed:@"Tabbar_on_01"] ; tab_01_off_image = [UIImage imagenamed:N@"Tabbar_off_01"] ;}[[[self.tabbarController.tabbar items] objectAtIndex:index] setFinishedSelectedImage:tab_01_on_image withFinishedUnselectedImage:tab_01_off_image];
此图显示问题,红色是差距:
编辑添加代码以创建UITabbar
self.tabbarController = [[BaseTabbarController alloc] init];self.tabbarController.delegate = self;self.tabbarController.vIEwControllers = @[navControll1,navControll2,navControll3,navControll4,navControll5];self.window.rootVIEwController = self.tabbarController;
我感谢你们提供的任何帮助
解决方法 我终于找到了解决方案.更改每个tabbarItem的imageInsets就可以了.tabbarItem1.imageInsets = UIEdgeInsetsMake(6,-6,0);tabbarItem2.imageInsets = UIEdgeInsetsMake(6,0);tabbarItem3.imageInsets = UIEdgeInsetsMake(6,0);tabbarItem4.imageInsets = UIEdgeInsetsMake(6,0);tabbarItem5.imageInsets = UIEdgeInsetsMake(6,0);总结
以上是内存溢出为你收集整理的ios7 – 自定义UItabbar底部有一个空白全部内容,希望文章能够帮你解决ios7 – 自定义UItabbar底部有一个空白所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)