Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5009] Change the text of switch control on iphone

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2012-05-29T15:36:00.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFrancisco Antonio Duran Ramirez
AssigneeNeeraj Gupta
Created2011-08-15T10:47:27.000+0000
Updated2014-06-19T12:46:19.000+0000

Description

Bug

Problem

On iphone you can not change the text of the switch control.

Reproducible steps:

1.Run the code below.

Expected behavior

Customer wants to change the text of the switch control on iphone

Sample Code:


var win1 = Titanium.UI.createWindow({  
    title:'My window',
    backgroundColor:'#fff'
});

var basicSwitch = Titanium.UI.createSwitch({
        value:false,
        top:30,
        titleOff:'Hi',
        titleOn:'Hello'
});


win1.add(basicSwitch);


// open tab group
win1.open();


Helpdesk

APP-667342

Comments

  1. Blain Hamon 2011-12-16

    Unfortunately, this is not possible. https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UISwitch_Class/Reference/Reference.html The underlying native UISwitch class offers no means to change the text. iOS actually changes localizes the text automatically, and in cases where 'on' and 'off' would be too long, use 1 and 0. Proposing we change this to 'won't fix' or 'hold'. Updating this into a feature request since this is a request for added functionality.

JSON Source