ratingbar

Using rating bar in android

有些话、适合烂在心里 提交于 2019-12-11 02:15:50
问题 I have a rating Bar <RatingBar android:id="@+id/RATINGinitialvalueratingID" style="?android:attr/ratingBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_below="@+id/RATINGseekBarID" android:isIndicator="false" android:numStars="5" /> Say there are three stars in this .... i have two questions How to show full stars all the time ? How to disable editing of stars (static display of allocated rating)? 回答1

How to center a RatingBar in Android

断了今生、忘了曾经 提交于 2019-12-10 22:05:24
问题 I have created a custom RatingBar as described in one of the tutorials given here on stack-overflow and it's looking great, the problem is with the centering of the image. here is what I've got: As you can see the TextView is centered vertically in the LinearLayout, but the RatingBar is at the top of it. Here is my xml code of this image: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView1" android:layout

Android RatingBar

末鹿安然 提交于 2019-12-10 11:41:31
问题 I'm new to android development I need to create a RatingBar that shows rating according to Application details . My App calculate a value according to user input and it will be shown in RatingBar . That bar only shows the value (eg. 4/5 stars ) according to the calculated value I need to create it that users can't change RatingBar's value directly .They only enter the input and that input calculate some value and that value need to be displayed in RatingBar. Can you please help me to do this?

Android using setNumStars to change stars during execution make the ratings act strange

馋奶兔 提交于 2019-12-10 08:38:10
问题 I'm using rb.setNumStars(int) to change the stars form a given default value (say 5) to a new one with app preferences (say 4). The code performs Ok and after refresh the fragment, I can see the change in the stars number to any integer I set (the bar has a StepSize of 1). The problem is that when I try to set the rating on that bar, the filled stars does not coincide with the rating value, and I have to touch in strange places to get come values, i.e. if I touch the fist star, I get a rating

进度条(SeekBar和RatingBar)—Mars Android开发视频之第一季第十八集(重)

∥☆過路亽.° 提交于 2019-12-09 11:49:38
1· SeekBar的主要属性 进度条最大值:max 当前进度:progress 次要进度的值:SecondaryProgress 特点:用户能够来回拖拽。 适用于: 常用在播放器上面,当前进度代表播放进度;次要进度表示缓冲进度。 下面这是一个 最大进度100,当前进度30,次要进度50的SeekBar: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <SeekBar android:id="@+id/seekBar_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="50dp" android:max="100" android:progress="30" android:secondaryProgress="50"/> </RelativeLayout> 2· SeekBar的监听器 接口

Why size of rating bar not decreasing?

限于喜欢 提交于 2019-12-08 12:50:17
问题 I want to decrease the size of the rating bar, but I'm unable to do so. I have tried to apply on rating bar still there is no change on rating bar size. Please help Here is style.xml <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="AppTheme" parent="android:Theme.Light" /> <style name="ratingBar" parent="@android:style/Widget.RatingBar"> <item name="android:maxHeight">10dip</item> <item name ="android:maxWidth">10dip</item> </style> </resources> main.xml

Android自定义RatingBar(评分控件)

☆樱花仙子☆ 提交于 2019-12-07 02:05:26
RatingBar简单介绍 RatingBar是基于 SeekBar (拖动条)和 ProgressBar (状态条)的扩展,用星形来显示等级评定, 在使用默认RatingBar时,用户可以通过触摸/拖动/按键(比如遥控器)来设置评分, RatingBar自带有两种模式 ,一个小风格 ratingBarStyleSmall ,大风格为 ratingBarStyleIndicator , 大的只适合做指示,不适用与用户交互。 黄色星形为 自定义RatingBar 小绿色为自带的 ratingBarStyleSmall 大绿色为自 带的 ratingBarStyleIndicator 通过设置 style="XXXXXXXXXXXXX" 进行设置切换(比如: style="?android:attr/ratingBarStyleIndicator" ) 自定义RatingBar需要注意的地方 一般情况下,系统自带的RatingBar是远远无法满足开发需求的,我们根据图片自定一个RatingBar,在开始实现自定义RatingBar之前,顺带说一下res目录下图片放置目录的区别: 在android sdk 1.5版本之前res目录下面只有一个drawable一个目录,在android sdk 1.6版本以后就出现了三个目录,分别是 drawable-hdpi、drawable-ldpi

Can't change the size of custom RatingBar

心已入冬 提交于 2019-12-06 09:05:37
I am trying to make custom RatingBar for my android app in which i can change the default size and color of RatingBar. For this purpose i have written styles for CustomRatingBar like this: <style name="CustomRatingBar" parent="@android:style/Widget.RatingBar"> <item name="android:progressDrawable">@drawable/custom_ratingbar</item> <item name="android:minHeight">25dp</item> <item name="android:maxHeight">25dp</item> </style> But the size is not changed rather it shrinks the rating bar like this: Drawable files are : custom_ratingbar.xml , custom_ratingbar_empty , custom_ratingbar_filled In my

Hide shadow of rating bar

落爺英雄遲暮 提交于 2019-12-06 00:19:58
问题 Customizing RatingBar shows me shadow How to hide this shadow ? <RatingBar android:id="@+id/ratingBarMain" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView6" android:layout_toRightOf="@+id/imgThumbFix" android:clickable="false" android:progressDrawable="@drawable/ratingbar_red_small" android:stepSize="1" /> 回答1: set android:layout_height="EQUAL_TO_IMAGE_HEIGHT" example android:layout_height="35dp" 回答2: The problem here is: It is

Android 自定义进度条(指示器)

本秂侑毒 提交于 2019-12-05 16:33:50
进度条分类 Android中进度条控件有3个(不算ProgressDialog),分别是ProgressBar、SeekBar和RatingBar,对于自定义样式来说又得按照需求分为2中情况,第一种是刻度型,第二种是循环类型。 一、“刻度型”进度条(指示器) 也就是他有起点和终点,起点值小于终点值 这种样式的修改,要修改三个属性即可分别是: 背景(主要是进度的轨道样式) 第一级别滚动条progressDrawable 第二级别progressDrawable 遗憾的是Android提供的api很难设置,不过可以通过LayerListDrawable实现,下面以RatingBar或者SeekBar为例子展示 <?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/secondaryProgress" android:drawable="@drawable/unselect"> <