智慧北京:引导页面静态点的添加

来源:互联网 发布:ios清除文稿与数据 编辑:程序博客网 时间:2024/05/21 23:37

1、静态点容器

2、给ViewPager加上静态点,并设置形状和参数

————静态点容器——————

 <!-- 静态点容器 -->    <LinearLayout        android:orientation="horizontal"        android:id="@+id/guide_container_point"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentBottom="true"        android:layout_centerHorizontal="true"        android:layout_marginBottom="40dp" >    </LinearLayout>
———设置点的参数和形状—————
<span style="white-space:pre"></span>for (int i = 0; i < imgRes.length; i++){......// 添加静态点 point = new View(this);point.setBackgroundResource(R.drawable.guide_point_shape);LinearLayout.LayoutParams  params=new LinearLayout.LayoutParams(20,20);//点的大小if(i!=0){params.leftMargin=10;//距离}mContainerPoint.addView(point,params);}


———点的形状—————

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="oval" >    <solid android:color="#CCCCCC"/>    <corners android:radius="5dp"/></shape>


0 0