Android 无缝轮播实现——本地加载图片轮播(一)

本文介绍了如何在Android应用中实现无缝轮播效果,包括布局文件activity_main.xml的编写,Java代码的实现,以及创建drawable资源文件not_pitch_viewpage_paint.xml和pitch_viewpage_paint.xml来设置选中和未选中的样式。
摘要由CSDN通过智能技术生成

大家好,第一次开始写博客,希望所写内容对大家有所帮助!

关于轮播效果相信大家经常都会在一些购物类或其他类型的App中中看到过吧,今天我们就来实现这一效果:


1、实现步骤

1)编写布局文件 activity_main.xml

<span style="font-size:18px;"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <FrameLayout
        android:id="@+id/lunbo_view"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:background="#DCDCDC" >
	<!-- 注意程序中要导入v4jar包 -->
        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:background="#ffffff" >
        </android.support.v4.view.ViewPager>

        <LinearLayout
            android:id="@+id/paintview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|bottom"
            android:layout_marginBottom="10dp"
            android:background="#00000000"
            android:orientation="horizontal" >
        </LinearLayout>
    </FrameLayou
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值