HorizontalScrollView滑动"/>
HorizontalScrollView滑动
1:创建布局
<RelativeLayout xmlns:android="" xmlns:app="" xmlns:tools="" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.zhoukao3_1.MainActivity"> <HorizontalScrollView android:id="@+id/hsv" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none" ><LinearLayout android:id="@+id/line" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" ></LinearLayout> </HorizontalScrollView> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/hsv" /></RelativeLayout>
2:MainActivity里的逻辑
private ViewPager viewPager;private HorizontalScrollView horizontalScrollView;private LinearLayout linearLayout;private String[] titles={"推荐","北京","大燕网","娱乐",
更多推荐
HorizontalScrollView滑动
发布评论