zoukankan      html  css  js  c++  java
  • 自定义RatingBar

    3.layer-list   
    简介:
    将多个图片或上面两种效果按照顺序层叠起来
    例如:

    在布局文件中A.xml中:

     
    <RatingBar
    android:id="@+id/rb_star"
    android:layout_width="wrap_content"
    android:layout_height="15dp"
    android:layout_below="@+id/tv_name"
    android:layout_marginTop="4dp"
    android:layout_toRightOf="@+id/iv_icon"
    android:isIndicator="true"
    android:progressDrawable="@drawable/custom_ratingbar"
    android:rating="2" />
     
    在状态选择器custom_ratingbar.xml中:
    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- android:id="@android:id/background" 系统自带Id-->
    <item
     
    android:id="@android:id/background"
    android:drawable="@drawable/rating_small_empty"
    />
     
    <item
    android:id="@android:id/secondaryProgress"
    android:drawable="@drawable/rating_small_half"
    />
     
    <item
    android:id="@android:id/progress"
    android:drawable="@drawable/rating_small_full"
    />
     
    </layer-list>
     
     
     注意:shape ,selector ,layer-list详细解析:
    http://blog.csdn.net/brokge/article/details/9713041
  • 相关阅读:
    php基础语言
    cookie和setting
    php数据连接
    php连接sql
    php提交
    今天学习了php的数据类型
    第一天进入php,这只是自己的一个心情
    02-07 (2) 自连接
    内连接 和左连接查询 02-07 (1)
    out 和ref 的区别
  • 原文地址:https://www.cnblogs.com/SoulCode/p/6393275.html
Copyright © 2011-2022 走看看