如何在Android中获取ViewGroup的子视图?

Hos*_*BAR 2 android view android-webview viewgroup

我必须得到WebView的子视图.对于一些文本操作,我想知道是否有一种方法来设置子视图的属性,例如:

View[] childs = webView.getChilds;
View ch = childs[0];
ch.setText("manipulated text");
Run Code Online (Sandbox Code Playgroud)

小智 6

WebView有方法getChildCount()getChildAt(int index).您可以尝试使用这些方法,但更好的解决方案是Bixi的方法.