高仿百度糯米
作者:yangwang
高仿百度糯米iOS,版本號:5.13.0;高仿百度糯米iOS采用以storyboard創建界面為主的方式來開發,跟官方的純代碼+少量的xib方式以作區別。最新代碼可參考我的GitHub鏈接:https://github.com/lookingstars/nuomi 如果你覺得不錯,歡迎star哦。gif圖1M多大小,當前網站上傳不了,GitHub鏈接下有gif圖.
源碼簡介:高仿百度糯米iOS,版本號:5.13.0;高仿百度糯米iOS采用以storyboard創建界面為主的方式來開發,跟官方的純代碼+少量的xib方式以作區別。最新代碼可參考我的GitHub鏈接:https://github.com/lookingstars/nuomi 如果你覺得不錯,歡迎star哦。gif圖1M多大小,當前網站上傳不了,GitHub鏈接下有gif圖.
源碼效果:
源碼片段:
- - (void)initTabBarItem {
- UITabBar *tabbar = self.tabBar;
- // self.tabBarController.tabBar;
- UITabBarItem *item0 = [tabbar.items objectAtIndex:0];
- UITabBarItem *item1 = [tabbar.items objectAtIndex:1];
- UITabBarItem *item2 = [tabbar.items objectAtIndex:2];
- UITabBarItem *item3 = [tabbar.items objectAtIndex:3];
- UITabBarItem *item4 = [tabbar.items objectAtIndex:4];
- item0.selectedImage = [[UIImage imageNamed:@"icon_tab_shouye_highlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item0.image = [[UIImage imageNamed:@"icon_tab_shouye_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item1.selectedImage = [[UIImage imageNamed:@"icon_tab_fujin_highlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item1.image = [[UIImage imageNamed:@"icon_tab_fujin_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item2.selectedImage = [[UIImage imageNamed:@"tabbar_voice_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item2.image = [[UIImage imageNamed:@"tabbar_voice_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item2.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);//注意這里的兩個值
- item3.selectedImage = [[UIImage imageNamed:@"tab_icon_selection_highlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item3.image = [[UIImage imageNamed:@"tab_icon_selection_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item4.selectedImage = [[UIImage imageNamed:@"icon_tab_wode_highlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- item4.image = [[UIImage imageNamed:@"icon_tab_wode_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- //改變UITabBarItem字體顏色
- [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:navigationBarColor,UITextAttributeTextColor, nil] forState:UIControlStateSelected];
- }
責任編輯:倪明
來源:
devstore