2012-10-24 16 views

回答

2

你爲什麼不使用findViewById?

TextView subElement = (TextView) webview.findViewById(R.id.subelement); 
subElement.setText("Oh Hi"); 

如果你真的想遍歷孩子,你還可以使用ViewGroup::getChildAt()ViewGroup::getChildCount()

+0

我不知道內部的意見,你可以寫一些應用程序代碼?謝謝。 –

+0

如果您需要代碼示例,我需要的僅僅是在我的文章中:我強烈建議您閱讀Android培訓頁面:http://developer.android.com/training/index.html,因爲它是一些非常基本的Android方法 –

+0

* * findViewById()**是嚴格的資源 – BORSHEVIK

6

的WebView有方法getChildCount()getChildAt(int index)。你可以嘗試使用這些方法,但更好的解決方案是碧溪的方法。

相關問題