Skip to content

Instantly share code, notes, and snippets.

@csemrm
Created December 2, 2013 13:13
Show Gist options
  • Save csemrm/7749240 to your computer and use it in GitHub Desktop.
Save csemrm/7749240 to your computer and use it in GitHub Desktop.
TableView inside ScrollView with pinch event
var win = Ti.UI.createWindow();
win.title = "Test";
var table = Ti.UI.createTableView({
top : 30
});
var scrollView = Ti.UI.createScrollView({
backgroundColor : '#fff',
contentWidth : 'auto',
contentHeight : 'auto',
width : Ti.UI.FILL,
height : Ti.UI.FILL,
top : 0,
bottom : 0,
showVerticalScrollIndicator : true,
showHorizontalScrollIndicator : true,
//Here you can determine the max and min zoom scale
maxZoomScale : 100,
minZoomScale : 1.0,
//With this property you can set the default zoom
zoomScale : 1
});
var rowMessageText = Ti.UI.createLabel({
textAlign : "left",
color : "#000",
left : 15,
top : 10,
right : 10,
font : {
fontSize : 14
},
text : "******start*********\n\nThe quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog \n\n The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dog\n\nThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dog\n\nThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dog\n\nThe quick brown fox jumps over the lazy dog\n\nThe quick brown fox jumps over the lazy dog\n\nThe quick brown fox jumps over the lazy dog \n\n The quick brown fox jumps over the lazy dog \n\n******end****** ",
height : Ti.UI.FILL,
bottom : 10
});
var arr = [];
var row = Ti.UI.createTableViewRow();
row.add(rowMessageText);
arr.push(row);
table.setData(arr);
/**/
scrollView.add(table);
win.add(scrollView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment