浏览代码

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
     }