我是Android開發新手&我需要經驗豐富的老師給予真誠的幫助,因爲我有許多困惑和疑惑。findViewById()有什麼用處
-2
A
回答
1
1
認爲它會給一個參考視圖
我。 Ë:
setContentView(R.layout.webview_page);
WebView web = (WebView) findViewById(R.id.myWebView);
會給你參考,你在你的setContentView()
它要求的WebView已經在XML被分配相應的id屬性指定的XML佈局命名myWebView的WebView中的TE能力佈局文件:
android:id="@+id/myWebView"
相關問題
- 1. 爲什麼findViewById(...)返回null?
- 2. findViewById返回null - 爲什麼?
- 3. 爲什麼findViewById返回null?
- 4. 爲什麼如果沒有調用setcontentview(),findViewById()返回null?
- 5. 什麼是newproxy,它有什麼用處?
- 6. 影子有什麼用處
- 7. Sproutcore/Qooxdoo有什麼用處?
- 8. shell中有什麼用處?
- 9. window.external有什麼用處?
- 10. findViewById有沒有副作用?
- 11. 爲什麼findViewById()會引發空異常? ?
- 12. 什麼是功能findViewById在android
- 13. Android需要什麼才能返回findViewById()?
- 14. 什麼時候findViewById()返回null?
- 15. 爲什麼findViewById爲CardView返回null?
- 16. 爲什麼(ListView)findViewById返回null?
- 17. findViewById(R.id。什麼也沒找到
- 18. HI.I有findViewById
- 19. 使用findViewById更有效
- 20. numpy.random.seed()有什麼用處它有什麼區別嗎?
- 21. 使用內聯塊有什麼用處?
- 22. 爲什麼要使用websocket,使用它有什麼好處?
- 23. findViewById沒有解決
- 24. 元組有什麼好處?
- 25. StringBuilders有什麼好處?
- 26. 粘液有什麼好處?
- 27. AJAX有什麼好處?
- 28. 「svn:externals」有什麼好處?
- 29. Cakephp,它有什麼好處?
- 30. cURL有什麼好處?
它的名字不是很明顯嗎?您應該嘗試解釋您的困惑,因爲您的問題可以通過複製/粘貼文檔來回答。 – runDOSrun 2015-03-02 16:01:43