High imitation Baidu Nuomi

High imitation Baidu Nuomi

Source code introduction: High imitation of Baidu Nuomi iOS, version number: 5.13.0; High imitation of Baidu Nuomi iOS adopts the method of creating the interface mainly by storyboard, which is different from the official pure code + a small amount of xib method. The latest code can refer to my GitHub link: https://github.com/lookingstars/nuomi If you think it is good, welcome to star. The gif image is more than 1M in size, and the current website cannot upload it. There is a gif image under the GitHub link.

Source code effect:

Source code snippet:

  1. - ( void )initTabBarItem {
  2. UITabBar *tabbar = self.tabBar;
  3. // self.tabBarController.tabBar;  
  4. UITabBarItem *item0 = [tabbar.items objectAtIndex: 0 ];
  5. UITabBarItem *item1 = [tabbar.items objectAtIndex: 1 ];
  6. UITabBarItem *item2 = [tabbar.items objectAtIndex: 2 ];
  7. UITabBarItem *item3 = [tabbar.items objectAtIndex: 3 ];
  8. UITabBarItem *item4 = [tabbar.items objectAtIndex: 4 ];
  9.       
  10. item0.selectedImage = [[UIImage imageNamed:@ "icon_tab_shouye_highlight" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  11. item0.image = [[UIImage imageNamed:@ "icon_tab_shouye_normal" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  12. item1.selectedImage = [[UIImage imageNamed:@ "icon_tab_fujin_highlight" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  13. item1.image = [[UIImage imageNamed:@ "icon_tab_fujin_normal" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  14.       
  15. item2.selectedImage = [[UIImage imageNamed:@ "tabbar_voice_icon" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  16. item2.image = [[UIImage imageNamed:@ "tabbar_voice_icon" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  17. item2.imageInsets = UIEdgeInsetsMake( 6 , 0 , - 6 , 0 ); //Note the two values ​​here  
  18.       
  19. item3.selectedImage = [[UIImage imageNamed:@ "tab_icon_selection_highlight" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  20. item3.image = [[UIImage imageNamed:@ "tab_icon_selection_normal" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  21. item4.selectedImage = [[UIImage imageNamed:@ "icon_tab_wode_highlight" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  22. item4.image = [[UIImage imageNamed:@ "icon_tab_wode_normal" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  23. //Change the font color of UITabBarItem  
  24. [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:navigationBarColor,UITextAttributeTextColor, nil] forState:UIControlStateSelected];
  25. }

Download address: http://download..com/data/2111750

<<:  Scan QR code barcode

>>:  Naughty Tom Cat

Recommend

How to completely deal with broken links on a website?

If there are broken links on the website, they mu...

Landing page conversion is poor? 3 reasons!

The quality of the landing page is related to the...

The future of consulting: augmenting human intelligence

“The greatest obstacle to wise action and the gre...

How to improve APP’s next-day retention?

What is next-day retention? Next-day retention, o...

Can three cobblers really be better than Zhuge Liang?

"Three cobblers are better than Zhuge Liang&...

There is only bad strategy, no bad traffic

In the past, traffic was king and growth hackers ...

Microsoft realizes airborne control of mobile phones

Microsoft researchers recently announced that they...