我使用这个库,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