|
- - K- Y; ]- u2 L4 ], w9 P+ H
- function GetAllText(view)
- E2 Z8 b6 x3 n! j# l/ P - textTable={}
3 l4 W+ W8 I8 }# X! ~9 u - function GetText(Parent)# Q0 X1 z# h* E4 ~: B* F
- local number=Parent.getChildCount()
3 \8 C9 y8 O ^/ [1 U9 | - for i=0,number do. v4 V- o- x, y+ s$ ^
- local view=Parent.getChildAt(i)
: E# s! ~. C# C: H& y" ?4 Z& ~ - if pcall(function()view.addView(TextView(activity))end) then. I8 K# L) |( q5 _ ?; S' x0 v! c
- GetText(view)
: ]9 F& Y& p& P+ }- |8 U- G - elseif pcall(function()view.getText()end) then- c" S4 n8 ]0 T2 V
- table.insert(textTable,tostring(view.Text))
- Y! Q8 o/ k' T- f4 I& q( @* _ - end
. ^5 G4 q1 T, a* w& K - end
6 v6 o- P* M+ {0 U) R; b; b7 h7 i - end# Z) V5 u. C" @- E5 t
- GetText(view)
' A. ~; B8 X8 Q( G4 ? - return textTable
: i7 M- [( k( `5 u - end
2 h$ {5 D1 C0 |& i - ; X$ k) b5 b: `+ L. S
- print(table.unpack(GetAllText(Parent)))
复制代码 |
|