大家好,第一次开始写博客,希望所写内容对大家有所帮助!
关于轮播效果相信大家经常都会在一些购物类或其他类型的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