Android RatingBar自定义替换系统图片
来源:互联网 发布:优化电脑最好的软件 编辑:程序博客网 时间:2024/05/16 23:33
1.自定义替换提醒☆图片,准备两个图片添加到系统中去:如下:
在drewable下定义一个图片资源ratingbar_drawable.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
layer-list
xmlns:android
=
"http://schemas.android.com/apk/res/android"
>
<
item
android:id
=
"
@+android:id/background
"
android:drawable
=
"@drawable/unselect"
>
</
item
>
<
item
android:id
=
"
@+android:id/progress
"
android:drawable
=
"@drawable/selected"
>
</
item
>
</
layer-list
>
备注:红色标注的id,不要更改。
1
2
3
4
5
6
7
8
9
<
style
name
=
"roomRatingBar"
parent
=
"@android:style/Widget.RatingBar"
>
<
item
name
=
"android:progressDrawable"
>@drawable/ratingbar_drawable</
item
>
<
item
name
=
"android:minHeight"
>48dip</
item
>
<
item
name
=
"android:maxHeight"
>48dip</
item
>
</
style
>
之后定义布局文件资源ratingbar.xml;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
LinearLayout
xmlns:android
=
"http://schemas.android.com/apk/res/android"
android:layout_width
=
"fill_parent"
android:layout_height
=
"fill_parent"
android:orientation
=
"vertical"
>
<
RatingBar
android:layout_width
=
"match_parent"
android:layout_height
=
"wrap_content"
style
=
"@style/roomRatingBar"
android:layout_marginLeft
=
"10dip"
android:id
=
"@+id/ratingbar"
android:rating
=
"1.5"
android:stepSize
=
"0.15"
android:numStars
=
"8"
/>
</
LinearLayout
>
0 0
- Android RatingBar自定义替换系统图片
- Android RatingBar自定义替换系统图片
- Android RatingBar自定义替换系统图片
- Android RatingBar自定义替换系统图片
- Android Ratingbar自定义替换系统图片
- android RatingBar自定义图片
- android RatingBar自定义图片
- android ratingbar自定义图片
- android RatingBar自定义图片
- Android-->RatingBar自定义大小,自定义样式(图片)
- Android基础_自定义RatingBar图片
- Android自定义RatingBar,图片可缩放
- android 自定义RatingBar图案
- Android自定义RatingBar && ProgressBar
- Android 自定义RatingBar样式
- android 自定义RatingBar图案
- Android自定义RatingBar
- android RatingBar 自定义
- myeclipse开启后卡死、building workspace缓慢 问题解决
- tomcat使用APR后性能竟然毫无提升
- 关于setBackgroundResource 中偶尔会出现padding失效问题
- android moveTaskToback的作用 退出后台
- 顺序表的基本操作
- Android RatingBar自定义替换系统图片
- iOS,利用URL Schemes跳转到设置wifi、蜂窝移动网络页面
- 机器学习系列(1)_逻辑回归初步
- Android 线程 thread的实现方法
- Ⅰ.18.2 如何实现Data-Driven Testing
- couldn't setup local SOCKS5 proxy on port 7777: Address already in use: JVM_Bind
- Android四大组件之Service详解
- <LeetCode OJ> 205. Isomorphic Strings
- 【d3.js教程12】地图