前言:Layout Inflation的作用正如inflate字面意思表示的一樣:膨脹,充氣。將XML文件轉換成View結構對象。在繪製界面時,經常會出現以下幾類問題,總的來說,還是因爲對Android的View結構和LayoutInflation不夠理解,所以從分析幾個問題出發,好好理解Android界面設計的一些思想和方法。
警告
Warning: “Avoid passing null as the view root” warning when inflating
view for use by AlertDialog.
異常
java.lang.IllegalStateException: The specified child already has a
parent. You must call removeView() on the child’s parent first.
BUG
將ListView中的每個Item高度設置爲wrap_content卻不起作用