瀏覽代碼

Clear component when setting title

Guy Carmeli 6 年之前
父節點
當前提交
543f720b6e
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      lib/android/app/src/main/java/com/reactnativenavigation/views/titlebar/TitleBar.java

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

@@ -43,6 +43,12 @@ public class TitleBar extends Toolbar {
43 43
         setContentDescription("titleBar");
44 44
     }
45 45
 
46
+    @Override
47
+    public void setTitle(CharSequence title) {
48
+        clearComponent();
49
+        super.setTitle(title);
50
+    }
51
+
46 52
     public String getTitle() {
47 53
         return super.getTitle() == null ? "" : (String) super.getTitle();
48 54
     }