HorizontalScrollView滑动

编程入门 行业动态 更新时间:2024-10-09 00:53:02

<a href=https://www.elefans.com/category/jswz/34/1754927.html style=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滑动

本文发布于:2024-02-07 07:32:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1754836.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:HorizontalScrollView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!