2014-12-02 67 views
0

昨天我得到一個採訪,他問了一個問題:Achive滾動滾動視圖沒有

如果佈局一個旗幟是存在的,這面旗幟的ListView的底部是存在的。不使用滾動視圖你將如何滾動屏幕。

編輯:

假設在xml文件中有線性佈局。然後將橫幅添加到線性佈局(在ImageView中),然後ListView就在那裏。現在滾動屏幕。它將如何滾動?

+0

你的問題我不清楚....那究竟是什麼? – 2014-12-02 10:37:56

+1

只需在ListView標題中添加橫幅即可。 – 2014-12-02 10:39:44

+1

可能的重複:http://stackoverflow.com/questions/1778485/android-listview-display-all-available-items-without-scroll-with-static-header – 2014-12-02 10:39:53

回答

0

我想你可以在自定義適配器的getView()方法的幫助下做同樣的事情。 像下面:

public View getView(int position, View convertView, ViewGroup parent){ 
    View view= convertView; 
    if(view==null){ 
     if(position==0){ 
      view=inflater.inflate(R.layout.imageViewLayout, null); 
     }else{ 
      view=inflater.inflate(R.layout.otherLayoutForListItem, null); 
     } 
    }else{ 

    } 
} 

,我認爲這可以幫助你 ,但如果你不希望以這種方式包括比u必須處理列表視圖的一些其他滾動選項