Android 评分栏不可见

问题描述

下面是我的评分栏代码

<ratingBar
        android:id="@+id/ratingBarU"
        android:layout_width="wrap_content"
        android:layout_height="45dp"
        android:layout_weight="1"
        android:numStars="10"
        android:progresstint="#FBE140"
        android:stepSize="1" />

我遇到的问题是,当我将样式设置为,

style="?android:attr/ratingBarStyleSmall"

评分栏变得不可见

image1

当我尝试时

style="?android:attr/ratingBarStyleIndicator"

enter image description here

评级栏显示所有 10 颗星,但在我的模拟器上运行时无法点击它们。 我想要的只是让我的评分栏显示所有 10 颗星并适合屏幕尺寸 请帮忙 !我对安卓开发很陌生

解决方法

想想您是否在 LinearLayout(Horizo​​ntal) 内部使用。你能在垂直线性布局中使用这个代码吗

        <RatingBar
        android:id="@+id/ratingBarU"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="?android:attr/ratingBarStyleIndicator"
        android:numStars="10"
        android:progressTint="#FBE140"
        android:stepSize="1" />
,

使 # userAgentSelector = ".user-agent" userAgentSelector = "div.user-agent" elementHandle = page.query_selector(userAgentSelector) uaHtml = elementHandle.inner_html() print("uaHtml=%s" % uaHtml) wrap_content 不使用特定的 dp 值,我也不明白您为什么使用 layout_height,因为您设置的特定高度为 { {1}}(应该是 wrap_content)并将宽度设置为 wrap_content。您的评分栏应如下所示

layout_weight

输出

enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...