2012-02-13 30 views
1

我附上了自定義列表視圖的屏幕截圖。我想有效地顯示它。什麼是最好的方式來做到這一點?在Android中顯示列表視圖的高效方式

enter image description here

感謝
斯納enter image description here

我已上傳另一個列表視圖的屏幕顯示。但對齊不正確。如何解決它?

+1

你高效的意思是什麼?太空智慧還是記憶智慧? – himanshu 2012-02-13 12:26:23

+0

如果你想讓你的列表更有效的空間明智,你可以使用可擴展列表。以下是你可以實現的鏈接。列表顯示。 http://techdroid.kbeanie.com/2010/09/expandablelistview-on-android.html – himanshu 2012-02-13 12:41:19

回答

2

使用ListView有一個非常標準的方法來提高其性能。

@Override 
    public View getView(int position, View convertView, ViewGroup parent) { 

     if (convertView == null) { 
      convertView = getLayoutInflater().inflate(R.layout.text_item, parent, false); 
     } 

     ((TextView) convertView).setText(getItem(position)); 

     return convertView; 
    } 

基本上,你不需要一直膨脹convertview,你可以膨脹一次,並在下次使用它。以上是一個非常標準的做法,在http://android.cyrilmottier.com/?p=422

0

讀到它。如果你是在談論如何使外觀更加美觀的話,我會建議你使用Table佈局的每一行內組織所有的信息

相關問題