Android HorizontalScrollView 水平滑動 裏面放listView 解決滑動衝突

<HorizontalScrollView
            android:id="@+id/assets_history_chart_scroll_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true">
        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >
            <ListView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:id="@+id/assets_history_chart_listview">
            </ListView>
        </LinearLayout>
    </HorizontalScrollView>

ListView要使用系統原來的,不能使用自定義的

在對應的Activity中重寫這個方法
class AssetsHistoryChartActivity extends AbstractActivity implements View.OnTouchListener

@Override
    public boolean onTouch(View v, MotionEvent event) {
        return super.onTouch(v, event);
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章