2017-08-14 91 views

回答

0

您需要從適配器調整getView方法以滿足您的需求。

定義方法getViewhere爲您提供試圖顯示的數據集中項目的位置。

所有你需要做的是自定義基於位置的膨脹視圖就像你問

getView(int position, 
       View convertView, 
       ViewGroup parent){ 
    //inflate the view 
    View v = LayoutInflator.from(parent).inflate(R.layout.your_layout,parent,false); 
    TextView txt = (TextView) v.findViewById(R.id.your_txt); 
    if(position == 0){ 
    txt.setTextSize(//get the dimen from resources); 
    } 
    return v;  
    } 
+0

我這樣做,只是想知道如何設置文字大小。經過一番研究,我知道如何編碼。不管怎麼說,還是要謝謝你。 –

相關問題