Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8937] iOS: Feature to add the scroll enable/disable property to a scrollview

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-12-21T05:40:30.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-14 API, Release 3.0.0
ComponentsiOS
Labelsapi, module_scrollview, qe-review, qe-testadded
ReporterVarun Joshi
AssigneeVishal Duggal
Created2012-04-30T17:51:38.000+0000
Updated2012-12-21T05:40:30.000+0000

Description

It has been requested to add a new property to enable/disable scroll in a scrollview just like it is in a tableview. The following change could work (provided by the customer): In the TiUIScrollView.m add the following code: {noformat} -(void)setScrollable_:(id)args { [[self scrollView] setScrollEnabled:[TiUtils boolValue:args def:YES]]; } {noformat}

Comments

  1. Neeraj Gupta 2012-06-26

    Please make sure that this property is available on all platforms before resolving this ticket.
  2. Vishal Duggal 2012-07-09

    Test Case
       
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
        
       var sv = Ti.UI.createScrollView({
       	width:100,
       	height:200,
       	contentWidth:'auto',
       	contentHeight:'auto',
       	borderColor:'green',
       	borderWidth:1
       })
       
       for (var i=0;i<40;i++){
       	var top = 40*i;
       	var v = Ti.UI.createLabel({
       		backgroundColor:'white',
       		width:100,
       		height:40,
       		top:top,
       		text:'Label '+i,
       		textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER
       	})
       	sv.add(v);
       }
       
       win.add(sv);
       
       var b1 = Ti.UI.createButton({
       	height:40,
       	left:0,
       	bottom:0,
       	title:'Scrolling Enabled?'
       })
       
       var b2 = Ti.UI.createButton({
       	height:40,
       	right:0,
       	bottom:0,
       	title:'Toggle'
       })
       
       b1.addEventListener('click',function(e){
       	if(sv.scrollingEnabled){
       		alert('TRUE');
       	}
       	else {
       		alert('FALSE');	
       	}
       })
       
       
       b2.addEventListener('click',function(e){
       	sv.scrollingEnabled = !sv.scrollingEnabled;
       })
       
       win.add(b1);
       win.add(b2);
       
       win.open();
       
  3. Vishal Duggal 2012-07-09

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2518
  4. Rima Umbrasas 2012-08-10

    Verified fixed with mobile sdk-2.2.0.v20120810080115 Titanium Studio, build: 2.1.1.201207271312
  5. Shyam Bhadauria 2012-09-04

    Re-opening to edit label

JSON Source