Issue
Proper methods are not able to programmatically hide and show the pagingControl.
Tested on
iOS 5 simulator & iPhone 4.3
Expected results
Control be shown
Unexpected results
Once the control is hidden, it never returns properly - it just a black view with no dots and no control color per original color.
Steps to reproduce
* Click the button twice to see the pagingControl behavior.
Repro sequence
var win = Titanium.UI.createWindow({backgroundColor: 'c6c6c6'});
/*
var view1 = Ti.UI.createView({
backgroundColor:'red'
});
var view2 = Ti.UI.createView({
backgroundColor:'blue'
});
*/
var s = Titanium.UI.createScrollableView({
//views:[view1, view2],
borderColor: 'red',
backgroundColor: 'purple',
width: 100, height: 200,
pagingControlColor: 'blue',
pagingControlHeight: 30,
showPagingControl: true
});
s.addView(Ti.UI.createView({ backgroundColor: 'green'}));
s.addView(Ti.UI.createView({ backgroundColor: 'white'}));
var b = Titanium.UI.createButton({
title: 'click',
width: 100,
height: 40,
bottom: 2
});
b.addEventListener('click', function() {
if (s.getShowPagingControl()) {
Ti.API.info('turning off paging control');
s.setShowPagingControl(false);
} else {
Ti.API.info('turning on paging control');
s.setShowPagingControl(true);
}
});
win.add(s);
win.add(b);
win.open();
Console log
{noformat}
[INFO] One moment, building ...
[INFO] Titanium SDK version: 1.8.0.1 (12/22/11 13:09 fbdc96f)
[INFO] iPhone Device family: universal
[INFO] iPhone SDK version: 5.0
[INFO] iPhone simulated device: iphone
[INFO] Launching application in Simulator
[INFO] Launched application in Simulator (6.62 seconds)
[INFO] Found 5.0 patch installed
[INFO] Application started
[INFO] T14088/1.0 (1.8.0.1.fbdc96f)
[INFO] turning off paging control
[INFO] turning on paging control
[INFO] turning off paging control
[INFO] turning on paging control
[INFO] turning off paging control
[INFO] turning on paging control
[INFO] turning off paging control
{noformat}
Use the following code to test setting height and showcontrols flag programmatically
Pull pending #1199
Verified fixed with SDK 1.9.0.v20120119131634 on iPhone 4s (5.0.1) and Simulator 5.0
updated labels
Anvil test case added. https://github.com/appcelerator/titanium_mobile/pull/4943