-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList+Button.test3.js
More file actions
99 lines (83 loc) · 1.8 KB
/
List+Button.test3.js
File metadata and controls
99 lines (83 loc) · 1.8 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// indexPath 和 index 可选其一,value 要符合 data 元素的定义
//$("listaaa").insert({
// indexPath: $indexPath(0, 0),
// value: "aaa!"
//})
var rowToDayList = [{
title: "Section 0",
rows: ["0-0", "0-1", "0-2"]
},
{
title: "Section 1",
rows: ["1-0", "1-1", "1-2", "9"]
},
{
title: "section 2",
rows: ["1-0", "1-1", "1-2"]
},
{
title: "section 3 星期一",
rows: ["1-0", "1-1", "1-2"]
}
]
$ui.render({
views: [
{
type: "list",
props: {
id: "listaaa",
rowHight: 68,
footer: {
type: "label",
props: {
height: 20,
text: "-我是有底线的-",
textColor: $color("#AAAAAA"),
align: $align.center,
font: $font(12)
}
},
data: rowToDayList
},
layout: $layout.fill
//function(make, view) {
//make.center.equalTo(view.super)
//make.width.equalTo(64)
//make.top.equalTo(0)
// }
},
{
type: "button",
props: {
title: "Button",
titleColor: $color("white")
},
layout: function (make, view) {
//make.center.equalTo(view.super)
//make.width.equalTo(view.super)
make.left.right.inset(20)
make.bottom.equalTo(-20)
make.height.equalTo(40)
},
events: {
tapped: function (sender) {
$ui.toast("Tapped")
}
}
}
]
})
// indexPath 和 index 可选其一,value 要符合 data 元素的定义
// $("listaaa").insert({
// indexPath: $indexPath(2, 1),
// value: "Hey!"
// })
// // 未成功
// $("listaaa").insert({
// indexPath: $indexPath(3, 1),
// value: "hskskshsh"
// })
// $("listaaa").scrollTo({
// indexPath: $indexPath(2, 0),
// animated: true // 默认为 true
// })