瀏覽代碼

fixed blank nav bar titles on Android when title font size not set. (#1516)

Justin Stanley 7 年之前
父節點
當前提交
0fbb067e09
共有 1 個文件被更改,包括 5 次插入6 次删除
  1. 5
    6
      android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java

+ 5
- 6
android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java 查看文件

@@ -151,12 +151,11 @@ public class TitleBar extends Toolbar {
151 151
     }
152 152
 
153 153
     protected void setTitleTextFontSize(StyleParams params) {
154
-        if (params.titleBarTitleFontSize == -1) {
155
-            return;
156
-        }
157
-        View titleView = getTitleView();
158
-        if (titleView instanceof TextView) {
159
-            ((TextView) titleView).setTextSize(((float) params.titleBarTitleFontSize));
154
+        if (params.titleBarTitleFontSize > 0) {
155
+            View titleView = getTitleView();
156
+            if (titleView instanceof TextView) {
157
+                ((TextView) titleView).setTextSize(((float) params.titleBarTitleFontSize));
158
+            }
160 159
         }
161 160
     }
162 161