Hi, I wonder is there any alternate way to scroll the window without using the ScrollView. This need raised to me as I am having so many issues in using the ScrollView. I am adding my controls to a view and adding that view to the scrollView but it changes the size of all of my UI controls from the specified sizes. I am doing it in this way. Please guide me where I am wrong:-
var scrol=Titanium.UI.createScrollView({ width: 320, height: Titanium.UI.SIZE, contentHeight: 'auto', contentWidth:'auto', scrollType: 'vertical', showVerticalScrollIndicator: true }); var view=Ti.UI.createView(); view.add(...); ... //add all controls to view. scrol.add(view); win.add(scrol); win.open();Also can anyone tell that how to control the back button operation in Android. I want to navigate to the previous screen but it closes the application when I press the back button. I am using Android 2.2 and Titanium 2.0.2. Any help in this regard would be greatly appreciated. Thanks.
1 Answer
Hi Muhammad Qasim Khan,
For back button in android you need to open window as modal like below code.
var winNew = Ti.UI.createWindow({ url : 'url.js', title : 'MyWin' }); winNew.open({ modal : true });or you have to open it in your tabgroup like this way.
var winNew = Ti.UI.createWindow({ url : 'url.js', title : 'MyWin' }); Ti.UI.currentTab.open(winNew);and for scrolling problem you have to set fix height for scrollview like height:420 or as per your requirement.
Best luck
Your Answer
Think you can help? Login to answer this question!