Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (device)
Viewing all articles
Browse latest Browse all 250

Scrollable view inside a scroll view

0
0

the code is working fine in emulator but I run the app in device its not working.any suggestion pls

Ti.UI.setBackgroundColor('#fff');
 
var win=Ti.UI.createWindow({
    modal:true,
    backgroundColor:'#fff',
    title:'Assessment'
});
var view1=Ti.UI.createView({
    backgroundColor:'#f00'
}); 
var view2=Ti.UI.createView({
    backgroundColor:'#00f'
}); 
var view3=Ti.UI.createView({
    backgroundColor:'#0f0'
}); 
var view4=Ti.UI.createView({
    backgroundColor:'#bdbdbd'
}); 
var view5=Ti.UI.createView({
    backgroundColor:'#0ff'
}); 
var view6=Ti.UI.createView({
    backgroundColor:'#0f0'
}); 
 
var topScrollContainerGroup=Titanium.UI.createScrollableView({
     top:'0dp', 
     height : 'auto',
     backgroundColor:'#FFF',
     contentHeight: 'auto',
     contentWidth: 'auto', 
     showVerticalScrollIndicator:false,
     showHorizontalScrollIndicator:true,
    // zIndex:100,
     showPagingControl:true
}); 
topScrollContainerGroup.addView(view4);
topScrollContainerGroup.addView(view5);
topScrollContainerGroup.addView(view6);
var topScrollContainerGroup1=Titanium.UI.createScrollableView({
     top:'0dp', 
     height : 'auto',
     backgroundColor:'#FFF',
     contentHeight: 'auto',
     contentWidth: 'auto', 
     showVerticalScrollIndicator:false,
     showHorizontalScrollIndicator:true,
    // zIndex:100,
     showPagingControl:true
}); 
topScrollContainerGroup1.addView(view1);
topScrollContainerGroup1.addView(view2);
topScrollContainerGroup1.addView(view3);
 
var scroll=Titanium.UI.createScrollView({
    top:'50dp',
    contentHeight: 'auto',
    contentWidth: 'auto',
    showVerticalScrollIndicator:true,
    showHorizontalScrollIndicator:false,
    backgroundColor:'#dceffe',
    scrollType: 'vertical',
    layout: 'vertical',
    //zIndex:1
});
 
scroll.add(topScrollContainerGroup);
scroll.add(topScrollContainerGroup1);
 
 
//DISABLE GLOBALSCROLLCONTAINER SCROLL
 
topScrollContainerGroup.addEventListener('scroll',function(e){
     scroll.scrollingEnabled = false;
      });
 
//ENABLE GLOBALSCROLLCONTAINER SCROLL
topScrollContainerGroup.addEventListener('scrollEnd',function(e){ 
    scroll.scrollingEnabled = true;
     });
topScrollContainerGroup1.addEventListener('scroll',function(e){
     scroll.scrollingEnabled = false;
      });
topScrollContainerGroup1.addEventListener('scrollEnd',function(e){ 
    scroll.scrollingEnabled = true;
     });
win.add(scroll);
win.open();

Viewing all articles
Browse latest Browse all 250

Latest Images

Trending Articles





Latest Images