feat:add view tag and findViewByTag

This commit is contained in:
刘涛
2020-07-04 10:04:40 +08:00
committed by osborn
parent 42a8eb4069
commit f693719974
9 changed files with 131 additions and 16 deletions

View File

@@ -9,13 +9,15 @@ class CounterView extends ViewHolder {
build(root: Group) {
vlayout(
[
this.number = text({
textSize: 40,
text({
textSize: 40,
tag:"tvNumber"
}),
this.counter = text({
text: "Click To Count",
text({
text: "Click To Count 1",
textSize: 20,
tag:"tvCounter"
}),
],
{
@@ -24,6 +26,8 @@ class CounterView extends ViewHolder {
space: 20,
}
).in(root)
this.number= root.findViewByTag("tvNumber")!
this.counter= root.findViewByTag("tvCounter")!
}
}