Problem
The UI.Switch.verticalAlign property has no effect, either with the CHECKBOX or TOGGLEBUTTON style.
Test Case
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var basicSwitch = Ti.UI.createSwitch({
color: 'black',
style: Ti.UI.Android.SWITCH_STYLE_TOGGLEBUTTON,
titleOn:'Notifications Enabled',
titleOff:'Notifications Disabled',
// style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX,
title:'Notifications',
// textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
verticalAlign:Ti.UI.TEXT_ALIGNMENT_TOP,
value:true,
width: 300, height:220
});
win.add(basicSwitch);
basicSwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + basicSwitch.value);
});
win.open();
// print initial value
Ti.API.info('Switch value: ' + basicSwitch.value);
try this code on line:13 verticalAlign:Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP, it works fine. Issue does not reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 Emulator: Android version: 2.2
Closing ticket as invalid.