2015-05-05 37 views
0

新來的超音速/類固醇/ Appgyver AngularJS更改超級導航欄,按鈕標題

我知道這是行不通的,但有一些變種,將工作:

<super-navbar-button side="left"> 
    {{ titleButtonLeft }} 
</super-navbar-button> 
<super-navbar-button side="right"> 
    {{ titleButtonRight }} 
</super-navbar-button> 

$scope.titleButtonLeft = "Left" 
$scope.titleButtonRight = "Right" 

或者,可以通過super-navbar-buttons上的代碼更改標題,而無需刪除和添加它們。

似乎無法與專門訪問按鈕,例如:

supersonic.ui.navigationBar.buttons.right[0] 

supersonic.ui.views.current.navigationBar.buttons.left[0] 

即使它們應該駐留在其中的某處,根據:

http://docs.appgyver.com/supersonic/guides/ui/native-components/navigation-bar/#programmatic-apis

有什麼建議嗎?

回答

0

以下是我如何更新導航欄按鈕(包括文本)的示例。

// setup buttons 
    var leftButton = new supersonic.ui.NavigationBarButton({ 
     title: "Previous", 
     onTap: function() { 
      // do something 
     } 
    }); 

// setup buttons 
    var rightButton = new supersonic.ui.NavigationBarButton({ 
     title: 'Next', 
     onTap: function() { 
      // do something 
     } 
    }); 

// setup buttons 
    var original = { 
     title: 'Nav Title', 
     overrideBackButton: false, 
     buttons: { 
      left: [leftButton], 
      right: [rightButton] 
     } 
    }; 


supersonic.ui.navigationBar.update(original); 

也有關於Muut Forum這類問題的討論。