瀏覽代碼

[iOS] Added option to remove default tab bar shadow (hairline) (#1297)

Grundmanis 7 年之前
父節點
當前提交
183fee0aef
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 1
    0
      docs/styling-the-tab-bar.md
  2. 6
    0
      ios/RCCTabBarController.m

+ 1
- 0
docs/styling-the-tab-bar.md 查看文件

@@ -20,6 +20,7 @@ Navigation.startTabBasedApp({
20 20
   tabBarBackgroundColor: '#551A8B' // change the background color of the tab bar
21 21
   tabBarTranslucent: false // change the translucent of the tab bar to false
22 22
   tabBarTextFontFamily: 'Avenir-Medium' //change the tab font family
23
+  tabBarHideShadow: true // iOS only. Remove default tab bar top shadow (hairline)
23 24
   forceTitlesDisplay: true // Android only. If true - Show all bottom tab labels. If false - only the selected tab's label is visible.
24 25
 }
25 26
 ```

+ 6
- 0
ios/RCCTabBarController.m 查看文件

@@ -103,6 +103,12 @@
103 103
     {
104 104
       self.tabBar.translucent = [tabBarTranslucent boolValue] ? YES : NO;
105 105
     }
106
+
107
+    NSString *tabBarHideShadow = tabsStyle[@"tabBarHideShadow"];
108
+    if (tabBarHideShadow)
109
+    {
110
+      self.tabBar.clipsToBounds = [tabBarHideShadow boolValue] ? YES : NO;
111
+    }
106 112
   }
107 113
   
108 114
   NSMutableArray *viewControllers = [NSMutableArray array];