您的位置:首页 > 其它

Andriod基础:RatingBar设置

2016-04-07 11:33 351 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: