Android Guides | Samples

Android.Widget.RatingBar Class

A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars.

See Also: RatingBar

Syntax

[Android.Runtime.Register("android/widget/RatingBar", DoNotGenerateAcw=true)]
public class RatingBar : AbsSeekBar

Remarks

A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar. The smaller RatingBar style ( NoType:android/R$attr;Href=../../../reference/android/R.attr.html#ratingBarStyleSmall) and the larger indicator-only style (NoType:android/R$attr;Href=../../../reference/android/R.attr.html#ratingBarStyleIndicator) do not support user interaction and should only be used as indicators.

When using a RatingBar that supports user interaction, placing widgets to the left or right of the RatingBar is discouraged.

The number of stars set (via RatingBar.NumStars or in an XML layout) will be shown when the layout width is set to wrap content (if another layout width is set, the results may be unpredictable).

The secondary progress should not be modified by the client as it is used internally as the background for a fractionally filled star.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Widget.RatingBar are listed below.

See Also: AbsSeekBar

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

IsIndicatorBoolean.
NumStarsInt32. Returns the number of stars shown.
OnRatingBarChangeListenerRatingBar+IOnRatingBarChangeListener.
RatingSingle. Gets the current rating (number of stars filled).
StepSizeSingle. Gets the step size of this rating bar.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Events