我有一个无法滚动的自定义列表视图。我只能用 tracball 滚动它,但我想用手滚动它。请帮助我,谢谢listview:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/setting_text_time1_alarm"
android:gravity="right"
/>
<ListView
android:layout_width="fill_parent"
android:layout_height="150dp"
android:id="@+id/setting_listview_time"
android:layout_margin="2dp"
>
</ListView>
</LinearLayout>
列表视图项目:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="50dp">
<Button
android:layout_width="fill_parent"
android:layout_height="50dp"
android:id="@+id/setting_text_time_list"
android:gravity="center"
android:background="#000000"
android:textColor="#ffffff"
android:layout_toRightOf="@+id/setting_on_off_time"
android:focusable="false"
/>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/setting_on_off_time"
android:layout_alignParentLeft="true"
android:focusable="false"
/>
</RelativeLayout>