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
  • 相关阅读:
    python的基本数据类型
    python数据基本运算处理===循环
    多态、多态性和鸭子类型
    菱形问题、类的组合
    类的继承
    面向对象基础
    软件开发三层架构
    logging模块
    json与pickle模块
    Webbrowser模拟百度一下子点击事件
  • 原文地址:https://www.cnblogs.com/SoulCode/p/6393275.html
Copyright © 2011-2022 走看看