问题描述
下面是我的评分栏代码
<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"
当我尝试时
style="?android:attr/ratingBarStyleIndicator"
评级栏显示所有 10 颗星,但在我的模拟器上运行时无法点击它们。 我想要的只是让我的评分栏显示所有 10 颗星并适合屏幕尺寸 请帮忙 !我对安卓开发很陌生
解决方法
想想您是否在 LinearLayout(Horizontal) 内部使用。你能在垂直线性布局中使用这个代码吗
<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
输出