我使用這個庫,https://github.com/umano/AndroidSlidingUpPanel,我把一個listview裏面,但它不工作,沒有滾動,爲什麼? 不僅listview,整個佈局不滾動,也沒有textview,也沒有圖像,什麼都沒有。 這是我的xml代碼:SlidingUpPanel中的ListView是不可滾動的
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Detalhe_linha"
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Próximo onibûs sai do ponto final em" />
<TextView
android:id="@+id/txtProx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="X minutos"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge" />
<GridView
android:id="@+id/tabelaHorarios"
android:layout_width="315dp"
android:layout_height="match_parent"
android:layout_x="0dp"
android:layout_y="123dp"
android:layout_gravity="center"
android:numColumns="3" >
</GridView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CCCC"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="34dp"
android:gravity="center|bottom"
android:text="Itinerário"
android:textSize="16sp" />
<TextView
android:id="@+id/brought_by"
android:layout_width="match_parent"
android:layout_height="34dp"
android:gravity="center|top"
android:text="Arraste para cima"
android:textSize="14sp"
android:autoLink="web" />
<TextView
android:id="@+id/itinerarios"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text=""
android:textSize="17sp"
android:autoLink="web" />
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</LinearLayout>
順便說一句,抱歉我的英文不好。
@ MSquare - 其實我在ListView中SlidingUpPanel。每個listview項目上都有一個按鈕。我想在按鈕上點擊關閉列表視圖項目來摺疊面板。我認爲setDragView()是摺疊面板的方法。但我不明白我如何在我的適配器類中實現?請告訴我,我該怎麼做。提前致謝。 – Lawrance
@MSquare在哪裏添加此方法以及在哪裏調用它? –
@iDroidExplorer,我檢查了AndroidSlidingUpPanel .java的github歷史記錄。方法是在2013年12月23日的提交中刪除了DragViewHit。 https://github.com/umano/AndroidSlidingUpPanel/commit/5986bd3cd947775ecce28878d3e7562287804bfa – MSquare