referece to : http://blog.csdn.net/beibeixiao/article/details/9032569
1. 在Android開發中會發現,有時listView和GridView的item頂層布局不起作用,即不能設置高度和寬度
原因是當用自定義的adapter時,如果使用convertView= mInflater.inflate(R.layout.material_grid_item, null)
方法就不會起作用,這個 方法的第二個參數是父View,傳入為空,所以沒有加載頂層布局,此時如果使用
convertView= mInflater.inflate(R.layout.material_grid_item, parent,false);傳入parent設置的高度和寬度就會起作用了。