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
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
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.
Closing ticket as "Not Our Bug".