Andriod基础:RatingBar设置

来源:互联网 发布:phonewindow源码 编辑:程序博客网 时间:2024/05/10 16:54
   <RatingBar android:layout_width="wrap_content"                    style="@android:style/Widget.RatingBar"                    android:layout_marginTop="2dp"                    android:id="@+id/rb_stars"                    android:isIndicator="true"                    android:layout_marginBottom="2dp"                    android:progressDrawable="@drawable/ratingbar_drawable"                    android:layout_height="14dp"/>

ratingbar_drawable.xml:

<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2008 The Android Open Source Project     Licensed under the Apache License, Version 2.0 (the "License");     you may not use this file except in compliance with the License.     You may obtain a copy of the License at          http://www.apache.org/licenses/LICENSE-2.0     Unless required by applicable law or agreed to in writing, software     distributed under the License is distributed on an "AS IS" BASIS,     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     See the License for the specific language governing permissions and     limitations under the License.--><layer-list xmlns:android="http://schemas.android.com/apk/res/android">    <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>


0 0
原创粉丝点击