Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9009] Android: UI.Switch - verticalAlign has no effect

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2013-02-28T09:55:08.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelscore, ipass1
ReporterPaul Dowsett
Assigneejithinpv
Created2012-05-06T08:24:35.000+0000
Updated2017-03-17T18:47:42.000+0000

Description

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);

Comments

  1. jithinpv 2013-02-28

    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
  2. Lee Morris 2017-03-17

    Closing ticket as invalid.

JSON Source