Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12532] Android: SWITCH_STYLE_CHECKBOX does not sizing correctly

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionNot Our Bug
Resolution Date2013-04-09T18:09:31.000+0000
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
LabelsSupportTeam, exalture
ReporterEduardo Gomez
AssigneeSunila
Created2013-01-31T21:44:59.000+0000
Updated2017-03-29T16:31:20.000+0000

Description

Problem

Android checkbox properties do not work correctly. Add a width and height to it, it looked messed up.

Expected behavior

When specify it to be "15dp" by "15dp" then it should work according to documentation. - Either DP units or SIZE behavior does not render it correctly.
var win = Ti.UI.createWindow({
    navBarHidden : true,
    orientationModes : [Titanium.UI.PORTRAIT],
    title: "Main Window",
    backgroundColor:"#fff",
});

var checkBox = Titanium.UI.createSwitch({ style : Titanium.UI.Android.SWITCH_STYLE_CHECKBOX, value : false, width:'25dp', height:'25dp', });
win.add(checkBox);
var win = Ti.UI.createWindow();
var switchx = Ti.UI.createSwitch({
  style: Titanium.UI.Android.SWITCH_STYLE_CHECKBOX,
  value: false,
  width: Ti.UI.SIZE, height: Ti.UI.SIZE // size themselves to their content by default
});
win.add(switchx);
win.open();

Tested on

2.3 OS at emulator wvga800 2.3 razr device

Comments

  1. Shameer Jan 2013-03-07

    The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
  2. Sunila 2013-04-09

    Width and height change the size of the control but doesn't change size of the box inside the control this results in having wider margin around the box. The actual box is controlled by the theme.
  3. Lee Morris 2017-03-29

    Closing ticket as "Not Our Bug".

JSON Source