【发布时间】:2020-02-14 12:03:39
【问题描述】:
我已经实现了 android 原生评级栏,但是当我将星数设置为 10 时,它会从屏幕末端切断它在某些设备上发生的情况,任何人都可以帮助我如何设法在所有移动设备上始终显示 10 星?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_marginBottom="@dimen/_15sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tValueLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_5sdp"
android:textSize="@dimen/_11ssp" />
<RatingBar
android:id="@+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/ratingBarStyleIndicator"
android:isIndicator="false"
android:layout_marginTop="@dimen/_5sdp"
android:stepSize="1.0" />
</LinearLayout>
【问题讨论】:
-
欢迎来到 SO 社区。请提供您的布局的完整代码。谢谢
-
@Muhammad Farhan 请检查我是否已更新问题
-
为什么要在父布局中添加 layout_marginBottom ??
-
请检查更新的答案@Android
标签: android android-layout screen-resolution ratingbar