android - 使用 ratingBarStyleSmall 样式时,ratingbar 不工作(不可点击)

标签 android xml ratingbar

当用户点击它时,ratingbar 没有改变?

她是我的xml代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.soulhis.testmaterialdesign.Test">
<RatingBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/ratingBar4"
    android:layout_centerVertical="true"
    style="?android:attr/ratingBarStyleSmall"
     android:layout_centerHorizontal="true" />
 </RelativeLayout>

问题出现在使用ratingBarStyleSmall时 在 android jellybean api 级别 17 上测试

最佳答案

所以我遇到了同样的问题,我将 android:isIndicator="false" 放到我的 RatingBar 标签中,它解决了我的问题,现在我的全速率条标签如下所示:

<RatingBar
    android:id="@+id/ratingReview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:numStars="5"
    android:isIndicator="false"
    style="@style/Base.Widget.AppCompat.RatingBar"/>

希望对您有所帮助。 更多信息可以引用this answer也是。

关于android - 使用 ratingBarStyleSmall 样式时,ratingbar 不工作(不可点击),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37907568/

相关文章:

java - 在循环中访问按钮 id 是一个好习惯吗?

android - 有没有办法禁用通过 proteus 膨胀的 webview 中的缓存

php - 具有 API 的数据库提供程序

xml - 用于纯 XML 而不是 SOAP 的 WSDL 服务

python - 使用 lxml python 的 xml 解析器问题

android - 自定义 RatingBar 始终显示五颗星

android - 发送数据到 Android 设备 Notification to IOS 设备

javascript - 对 JSON 的 SOAP 响应 (XML)

android - 自定义 RatingBar 样式只显示一个点,其他奇怪的行为

android - 具有自定义样式的评分栏显示不良图像