0

この質問で申し訳ありませんが、RatingBar 属性を理解するのに問題があります。

基本的に、合計 7 つ星の評価バーを作成しようとしていますが、毎回 0.5 つ星ずつ「ジャンプ」します。

以下は私が現在持っているものです。しかし、それは私に1/4の星と3/4の星を示しているようですが、適切な半分の星は決して示していません.

<RatingBar
    android:id="@+id/rating"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:rating="3.5"
    android:numStars="7"
    android:stepSize="0.5" />

評価と numStars の違いは何ですか? 必要なのは単純な 7 の額面だけです。

4

3 に答える 3

1

ドキュメントの引用:

Attribute Name  Related Method  Description
android:isIndicator setIsIndicator(boolean) Whether this rating bar is an indicator (and non-changeable by the user). 
android:numStars        The number of stars (or rating items) to show. 
android:rating      The rating to set by default. 
android:stepSize        The step size of the rating. 
于 2012-12-12T18:08:59.287 に答える
0

どうやら属性の現在の値は正しいようです。1/4 または 3/4 の星が表示される理由は、画面の幅が十分に長くないためです。ランドスケープに変更すると、うまく機能しました。

于 2012-12-12T18:36:21.863 に答える
0

1/7=0.1428 あなたの分母

分母の検索

于 2012-12-12T18:41:06.457 に答える