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

You'd never guess that plants can...

If we fast-forward a video of a plant's growt...

How to pour the perfect beer while watching a game?

Author: Li Cunpu, Associate Professor, College of...

Why are more and more strong typhoons coming earlier?

A strong typhoon is a tropical cyclone with great...

Why does the live broadcast room have to have the lowest price?

This year's relatively dull Double 11 caused ...

Is H5 really becoming popular?

A few days ago, I saw a friend in the Internet ci...

British Rail Operation Group: Introducing self-driving trains

A railway development report released by the Brit...

How to optimize Weibo advertising creativity?

Marketing status: The advertiser is a local O2O d...