zoukankan      html  css  js  c++  java
  • android评分条RatingBar自定义设置

    页面XML文件:

    <RatingBar 
             android:id="@+id/ratingbarId"
             style="@style/MyRatingBar"                - - 引用style XML文件 "name"为MyRatingBar
             android:layout_height="wrap_content" 
             android:layout_width="wrap_content" 
             android:numStars="5"
             android:stepSize="1.0"/>

     

    style XML文件:

    <resources>        
            <style name="MyRatingBar" parent="@android:style/Widget.RatingBar">     
            <item name="android:progressDrawable">@drawable/rating_bar_full</item>     
            <item name="android:minHeight">22dip</item>         - - 评分条最小高度和最大高度调整 
            <item name="android:maxHeight">25dip</item>     
        </style>     
    </resources>

     

    rating_bar_full XML文件:

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">     
        <item android:id="@+android:id/background"          - - 背景星 
              android:drawable="@drawable/star1" />     
        <item android:id="@+android:id/secondaryProgress"        - - 背景星
              android:drawable="@drawable/star1" />     
        <item android:id="@+android:id/progress"          - - 变化

              android:drawable="@drawable/star2" />     
    </layer-list>

  • 相关阅读:
    端午节习俗
    彩绘漂亮MM集
    高效使用数码相机的诀窍
    项目管理缩略语
    数码相机如何当做摄像头(文字版)
    标签式按纽
    显示一个Form中的所有内容
    生活中要常常鼓励别人
    青苹果论坛重新开放
    第一次爱的人
  • 原文地址:https://www.cnblogs.com/lechance/p/4373331.html
Copyright © 2011-2022 走看看