Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24841] iOS: Expose Alert Dialog TintColor

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-06-26T15:02:58.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sRelease 6.2.0
ComponentsiOS
Labelsalertdialog, qe-6.2.0, tintColor
ReporterJoseph Sachs
AssigneeHans Knöchel
Created2017-06-16T13:36:33.000+0000
Updated2017-06-26T15:04:59.000+0000

Description

Alert Dialog has had tintColor since iOS 8+:
UIAlertController *alertController = ....
[alertController.view setTintColor:[UIColor greenColor]];
Would it possible to implement this in Titanium?

Comments

  1. Hans Knöchel 2017-06-16

    You can use the Ti.UI.setTintColor('green') method / computed property for setting a global tint-color already, but I see the point of using it for the alert specifically as well. I assume myAlert.tintColor = 'green' does not work?
  2. Hans Knöchel 2017-06-16

    PR: https://github.com/appcelerator/titanium_mobile/pull/9150 Test-Case:
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
           title: 'Show Alert'
       });
       
       btn.addEventListener('click', function() {
           var alert = Ti.UI.createAlertDialog({
       		title: 'My Dialog',
       		message: 'Hello World',
       		buttonNames: ['OK'],
       		tintColor: 'red'
       	});
       	alert.show();
       });
       
       win.add(btn);
       win.open();
       
  3. Joseph Sachs 2017-06-16

       myAlert.tintColor = 'green'
       
    conforms very well :)
  4. Harry Bryant 2017-06-26

    Approved! tintColor property for AlertDialog is now supported. Tested with both string & hex color values, as well as checking for errors if incorrect argument values are specified. Tested On: iPhone 7 10.3.2 Device & Simulator Mac OS Sierra (10.12.5) Ti SDK: 6.2.0.v20170626070527 Appc NPM: 4.2.9 App CLI: 6.2.2 Xcode 8.3.3 Node v4.6.0 Closing ticket.

JSON Source