Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28211] iOS: The color property of Ti.UI.Button does not work when used in navbar

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsiOS
Labelsn/a
ReporterSatyam Sekhri
AssigneeVijay Singh
Created2020-10-28T02:50:47.000+0000
Updated2020-11-20T16:39:29.000+0000

Description

When a button is used in window for leftNavBar or rightNavBar, the color property does not work. Steps to Reproduce: 1. Create a titanium mobile app using the code below 2. Run on iOS device/sim 3. On the Red Window, click on the button "Open Blue Window" 4. Check the Left and Right navbar buttons in the blue window Actual Result: These buttons show the blue text color instead of the color assigned. Expected Result: The buttons used in navbar should show the text color assigned as color property.
var win2 = Titanium.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red Window'
});

var win1 = Titanium.UI.createNavigationWindow({
    window: win2
});
var lnv = Titanium.UI.createButton({
    title: 'Left',
    color: 'yellow'
});
lnv.addEventListener('click', function(){
    win1.closeWindow(win3, {animated:false}); 
});
var rightView = Ti.UI.createView();
var rnv = Titanium.UI.createButton({
    title: 'Right',
    color:'red'
});
rnv.addEventListener('click', function(){
    win1.closeWindow(win3, {animated:false}); 
});
var win3 = Titanium.UI.createWindow({
    backgroundColor: 'blue',
    title: 'Blue Window',
    leftNavButton:lnv,
    rightNavButton:rnv 
});

var button = Titanium.UI.createButton({
    title: 'Open Blue Window',
    color: 'black'
});
button.addEventListener('click', function(){
    win1.openWindow(win3, {animated:true});
});

win2.add(button);
var button2 = Titanium.UI.createButton({
    title: 'Close Blue Window'
});
button2.addEventListener('click', function(){
    win1.closeWindow(win3, {animated:false});
});

win3.add(button2);
win1.open();

Comments

  1. Satyam Sekhri 2020-10-28

    In the navbar, instead of using a button, if we use a label with colored text or use a view having a button with colored text shows up fine.
  2. Hans Knöchel 2020-10-28

    Buttons use the "tintColor" property for coloring.
  3. Vijay Singh 2020-11-04

    PR. - https://github.com/appcelerator/titanium_mobile/pull/12245 Test Case -
       var lnv = Titanium.UI.createButton({
           title: 'Left',
           color: 'yellow',
           tintColor:'green'  // color should have priority
       });
       
       var rnv = Titanium.UI.createButton({
           title: 'Right',
           tintColor:'green'
       });
       
       var win3 = Titanium.UI.createWindow({
           backgroundColor: 'blue',
           title: 'Blue Window',
           leftNavButton:lnv,
           rightNavButton:rnv 
       });
       
       var win1 = Titanium.UI.createNavigationWindow({
           window: win3
       });
       
       win1.open();
       
  4. Satyam Sekhri 2020-11-19

    FR Passed. Waiting for Jenkins build.
  5. Christopher Williams 2020-11-20

    merged to master. Backport PR for 9_3_X is merged as well.

JSON Source