• 自定义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基础前传(5)
    R语言之数据可视化
    R语言之数据可视化
    R语言基础
    R语言基础
    R语言基础
    R语言入门
    R语言入门
    用 python 爬取 gutenberg 上的英文科幻小说
    Python 在数据科学中的应用
  • 原文地址:https://www.cnblogs.com/SoulCode/p/6393275.html
Copyright © 2020-2023  润新知