Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7127] iOS: ScrollableView showPagingControl doesn't work properly after creation

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-02-09T23:47:43.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-02, Release 2.0.0, Release 1.8.1
ComponentsiOS
Labelsmodule_scrollableview, parity, qe-testadded
ReporterEduardo Gomez
AssigneeVishal Duggal
Created2012-01-12T10:31:07.000+0000
Updated2014-02-24T19:48:39.000+0000

Description

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}

Attachments

FileDateSize
PagingControlOFF.jpg2012-01-12T10:31:07.000+000028863
PagingControlON.jpg2012-01-12T10:31:07.000+000029215

Comments

  1. Vishal Duggal 2012-01-17

    Use the following code to test setting height and showcontrols flag programmatically
       var win = Titanium.UI.createWindow({backgroundColor: 'c6c6c6'});
       
       var s = Titanium.UI.createScrollableView({
          borderColor: 'red', 
          backgroundColor: 'purple',
          width: 200, height: 200, 
          pagingControlColor: 'blue',
          pagingControlHeight: 10
       });
       
       s.addView(Ti.UI.createView({ backgroundColor: 'green'}));
       s.addView(Ti.UI.createView({ backgroundColor: 'white'}));
       
       var b = Titanium.UI.createButton({
           title: 'Show/Hide',
           width: 100, 
           height: 40, 
           left:10,
           bottom: 2
       });
       
       b.addEventListener('click', function() {
           if (s.showPagingControl) {
               Ti.API.info('turning off paging control');
               s.setShowPagingControl(false);
       
           } else {
               Ti.API.info('turning on paging control');
               s.setShowPagingControl(true);
           }
       });
       
       var b1 = Titanium.UI.createButton({
           title: 'Size',
           width: 100, 
           height: 40, 
           right:10,
           bottom: 2
       });
       
       b1.addEventListener('click', function() {
           if (s.pagingControlHeight == 10) {
               Ti.API.info('Set height to 20');
               s.setPagingControlHeight(20);
       
           } else {
               Ti.API.info('Set height to 10');
               s.setPagingControlHeight(10);
           }
       });
       
       win.add(s);
       win.add(b);
       win.add(b1);
       win.open();
       
  2. Vishal Duggal 2012-01-17

    Pull pending #1199
  3. Eric Merriman 2012-01-19

    Verified fixed with SDK 1.9.0.v20120119131634 on iPhone 4s (5.0.1) and Simulator 5.0
  4. Wilson Luu 2012-02-01

    updated labels
  5. jithinpv 2013-11-10

    Anvil test case added. https://github.com/appcelerator/titanium_mobile/pull/4943

JSON Source