|
@@ -111,13 +111,12 @@ class BaseTabbarViewController: NSObject {
|
|
|
|
|
|
// v1.tabBarItem = ESTabBarItem.init(lottieAnimateContentView1, title: "社区", image: UIImage(named: "tabbar_home")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
|
|
|
// v2.tabBarItem = ESTabBarItem.init(lottieAnimateContentView2, title: "福利", image: UIImage(named: "tabbar_shopping")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
|
|
|
- v1.tabBarItem = ESTabBarItem.init(lottieAnimateContentView1, title: "社区", image: UIImage(named: "tabbar_home")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
- v2.tabBarItem = ESTabBarItem.init(lottieAnimateContentView2, title: "福利", image: UIImage(named: "tabbar_shopping")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
+ tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
|
|
|
+ tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "福利")
|
|
|
v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
|
|
|
-
|
|
|
- v4.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "消息", image: UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
- v5.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "我的", image: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
+ tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
|
|
|
+ tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
|
|
|
|
|
|
if UserModel.isTokenNil() {
|
|
|
setLoginOutTabBarItem()
|
|
@@ -240,6 +239,33 @@ class BaseTabbarViewController: NSObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// func tabBarViewController() -> BaseTabbarViewController {
|
|
|
+// let tabBarViewController = BaseTabbarViewController()
|
|
|
+//
|
|
|
+// let v1 = ShoppingMallViewController()
|
|
|
+// let v2 = ShoppingCartViewController()
|
|
|
+// let v3 = MineViewController()
|
|
|
+//
|
|
|
+// let n1 = BaseNavigationViewController.init(rootViewController: v1)
|
|
|
+// let n2 = BaseNavigationViewController.init(rootViewController: v2)
|
|
|
+// let n3 = BaseNavigationViewController.init(rootViewController: v3)
|
|
|
+//
|
|
|
+// tabBarItemStyle(navc: n1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "首页")
|
|
|
+// tabBarItemStyle(navc: n2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "购物车")
|
|
|
+// tabBarItemStyle(navc: n3, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的彩虹")
|
|
|
+//
|
|
|
+// tabBarViewController.viewControllers = [n1, n2, n3]
|
|
|
+// return tabBarViewController
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ private func tabBarItemStyle(navc : BaseViewController, normalImg : String, selectorImg : String, title : String){
|
|
|
+ navc.tabBarItem = UITabBarItem.init(title: title, image: UIImage(named:normalImg), selectedImage: UIImage(named:selectorImg))
|
|
|
+ navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:k333333Color], for: UIControl.State.normal)
|
|
|
+ navc.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:k333333Color], for: UIControl.State.selected)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
extension ESTabBar {
|