The tableview is not scrolling as expected.
I tested it on a mobile device and the scrolling worked fine, but it doesn't seem to work on tablets.
Please assist.
CODE
var win = Titanium.UI.createWindow({
title : 'Medall app',
backgroundColor : '#fff',
fullscreen : false,
navBarHidden : true,
layout : 'vertical',
});
var scrollView = Titanium.UI.createScrollView({
contentWidth : 'auto',
contentHeight : 'auto',
width : Titanium.UI.FILL,
height : Titanium.UI.FILL,
top : '0dp',
bottom : '0dp',
layout : 'vertical',
showVerticalScrollIndicator : true
});
win.add(scrollView);
var mainview = Titanium.UI.createView({
width : Ti.UI.FILL,
height : Ti.UI.FILL,
//layout : 'horizontal',
horizontalWrap : false,
//right : '10dp',
//left : '10dp',
layout : 'vertical',
//backgroundImage : '/images/backblue.png'
//backgroundColor : medblue,
backgroundColor : 'white',
bottom : '20dp'
//top : '20dp',
//backgroundColor:''
});
scrollView.add(mainview);
var tableview = Titanium.UI.createTableView({
//data : data,
backgroundColor : 'white',
width : '90%',
height : 0,
layout : 'horizontal',
padding : '10dp',
separatorColor : bordercolor_views_textfields,
top : '0dp',
borderColor : medblue,
scrollable : true
});
mainview.add(tableview);
var a=['1','2','3','4','5'];
for (var i = 0; i < a.length; i++) {
var row = Ti.UI.createTableViewRow({
height : '30dp',
layout : 'vertical',
className : 'row',
objName : 'row',
onClick : "delete",
onPress : "rowvalue",
backgroundColor : 'white',
//rightImage : '/images/Right_Arrow',
top : '0dp',
padding : '10dp',
width : '100%',
horizontalWrap : false,
layout : 'horizontal',
backgroundColor : 'white',
top : '10dp',
padding : '10dp',
});
var heading_report = Titanium.UI.createView({
width : '48%',
height : Ti.UI.SIZE,
//layout : 'horizontal',
horizontalWrap : false,
//right : '10dp',
//left : '10dp',
layout : 'vertical',
//backgroundImage : '/images/backblue.png'
backgroundColor : 'white',
left : '0dp',
left : '1%',
right : '1%',
padding : '10dp',
});
row.add(heading_report);
var heading_report_label = Ti.UI.createLabel({
text : a[i],
font : {
fontSize : '20dp',
fontWeight : 'bold'
},
color : bordercolor_views_textfields,
left : '0dp',
//left : '10dp',
//right : '10dp'
//bottom : '10dp'
});
heading_report.add(heading_report_label);
var heading_status = Titanium.UI.createView({
width : '48%',
height : Ti.UI.SIZE,
//layout : 'horizontal',
horizontalWrap : false,
//right : '10dp',
//left : '10dp',
layout : 'absolute',
//backgroundImage : '/images/backblue.png'
backgroundColor : 'white',
left : '1%',
right : '1%',
padding : '10dp',
});
row.add(heading_status);
var heading_status_label = Ti.UI.createLabel({
text : "" + a[i],
color : 'black',
font : {
fontSize : '20dp',
fontWeight : 'bold'
},
left : '0dp',
});
heading_status.add(heading_status_label);
data.push(row);
stableview.setData(data);
}
I also tried adding this code snippet to the manifest file, but it didn't resolve the issue:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="@style/Theme.MyTheme">
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" android:xlargeScreens="true"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</application>
</manifest>
</android>