-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExpandTextAreaInListView.js
60 lines (53 loc) · 1.59 KB
/
ExpandTextAreaInListView.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var myTemplate = {
properties: {
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,
selectionStyle: Ti.UI.iPhone.ListViewCellSelectionStyle.NONE,
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
// height: 95,
backgroundColor: 'green',
clipMode: Ti.UI.iOS.CLIP_MODE_DISABLED,
},
childTemplates: [
{
type: 'Ti.UI.TextArea',
bindId: 'input',
properties: {
top: 0,
bottom: 0,
left: 10,
right: 10,
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
color: 'black',
tintColor: 'black',
backgroundColor: '#889f29f9',
font: {
fontFamily: 'HelveticaNeue',
fontSize: 16,
},
scrollable: false,
scrollsToTop: false,
suppressReturn: false,
}
},
]
};
var listView = Ti.UI.createListView({
top: 40,
templates: { 'template': myTemplate },
defaultItemTemplate: 'template',
});
var sections = [];
var section = Ti.UI.createListSection();
var data = [
{ input: {value: 'One line. '}},
{ input: {value: 'Four Lines: 1 \n2 \n3 \n4'}},
{ input: {value: 'A lot of lines: 1 \n2 \n3 \n4 \n5 \n6 \n7 \n8 \n9 \n10'}},
];
section.setItems(data);
sections.push(section);
listView.setSections(sections);
win.add(listView);
win.open();