我正在开发一个 android 应用程序,我在其中显示每日频道时间表(多行)。现在在这我必须提供垂直和水平滚动性。垂直滚动是正常的,但水平滚动应该是同步的,即当用户水平滚动时,所有其他行也应该同步滚动。
我尝试使用表格布局,但它不符合我的要求,我也尝试过 TwoWayView,但我无法同步水平滚动。
我想知道我有人遇到过/解决过类似的情况。
对此的任何线索都将受到高度赞赏。
用于垂直和水平滚动的 xml:-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/vertical_scroll_view2">
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/horizontal_scroll_view2">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="910dp"
android:id="@+id/scheduleContainer"
android:orientation="vertical"
/>
</HorizontalScrollView>
</ScrollView>
..... TwoWayView 的 xml:-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/weekday"
android:layout_height="fill_parent"
android:layout_width="40dp"
android:textSize="12dp"
android:textStyle="bold" />
<com.mobiotics.tvb_stb.utilityclasses.TwoWayView
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/hlist"
style="@style/TwoWayView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@id/weekday"
android:scrollbars="none"
android:drawSelectorOnTop="false"
tools:context="com.mobiotics.tvb_stb.activity.HomeScreenActivity" />
</RelativeLayout>
我正在向线性布局添加双向列表。