0
A
回答
0
U可以使用rootView.removeAllViews();
以去除佈局中的所有視圖,例如
您的佈局是
<LinearLayout
android:id="@+id/llRootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
.......
</LinearLayout>
然後就可以調用從這個線性佈局
編輯刪除所有的意見
臨時從佈局移除視圖喲ü可以使用
llRootView.setVisibility(View.GONE);
使其可見再次使用
llRootView.setVisibility(View.VISIBLE);
相關問題
- 1. 在android中使用setcontentview
- 2. 只需使用「setContentView」或「startActivity」?
- 3. 不到的代碼使用的setContentView()時
- 4. 我怎麼使用的setContentView(r.layout.activity_main)多次
- 5. 使用setContentView的插頁式廣告
- 6. 的setContentView onRestoreInstanceState
- 7. 的setContentView麻煩
- 8. Android通知的setContentView
- 9. 在使用findViewById時onCreate()中的NullPointerException - 之前使用了setContentView?
- 10. setContentView從AsyncTask不可用
- 11. Android setContentView or Intents?
- 12. Alertdialog與setcontentview
- 13. Android更改setContentView
- 14. Android ProgressDialog with setContentView
- 15. setContentView問題
- 16. Android admob error setContentView
- 17. setContentView(R.layout.main);錯誤
- 18. SetContentView()錯誤:Android.Views.InflateException
- 19. Android和setContentView?
- 20. AsyncTask和setContentView
- 21. setContentView和Listeners
- 22. Android Studio onCreate setContentView
- 23. requestWindowFeature(Window.FEATURE_NO_TITLE)在setContentView()
- 24. Android setContentView問題
- 25. setContentView在片段
- 26. 無法在'setContentView()'後使用'findViewById()'獲取對EditText的引用
- 27. 如何測試對setContentView的調用?
- 28. 如何調用片段中的setContentView
- 29. Android setContentView崩潰我的應用程序
- 30. Android的對話主題,使的setContentView應用程序崩潰
設置另一個佈局沒有意見添加更改其可見或者可以稱之爲rootView.removeAllViews(); –
你可以給我一個如何定義rootView的例子嗎? – Rosenberg
rootView是你最上面的佈局 –