В моем приложении Android рейтинговые бары не видны. Он становится видимым только при прикосновении к нему и исчезает, как только я снимаю пальцы.
Мой код:
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/myratingStars"
android:layout_gravity="center_horizontal|center_vertical|center"
android:numStars="5"/>
Он не отображается в окне дизайна Lollipop emulator/real phone/Android Studio (в режиме API 23), но отображается в эмуляторе KitKat и в окне дизайна Android (в режиме API 15).
Полный файл макета:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="24dp"
android:orientation="vertical">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/myratingStars"
android:layout_gravity="center_horizontal|center_vertical|center"
android:numStars="5"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.AppCompatEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:maxLines="10"
android:id="@+id/myratingTxt"
android:layout_marginTop="12dp"
android:layout_marginBottom="2dp"
android:hint="@string/write_review"/>
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.AppCompatButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/submitReview"
android:text="@string/review_submit"
android:layout_gravity="center_horizontal|center|center_vertical"
android:textColor="@color/white"
android:onClick="submitReview"
android:layout_marginTop="8dp"
tools:visibility="visible"/>
</LinearLayout>
</LinearLayout>