java - 如何从 Android 的评级栏中删除填充?

标签 java android android-layout kotlin ratingbar

这个问题在这里已经有了答案:





How to reduce the space around rating bar in android

(3 个回答)


3年前关闭。




我的应用程序上有评分栏,它看起来像这样:

enter image description here

我尝试将填充设置为 0dp,但 View 没有任何变化。

 <RatingBar
      android:id="@+id/ratingBar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:numStars="5"
      android:layout_marginStart="16dp"
      android:isIndicator="false"
      style="@style/Widget.AppCompat.RatingBar"/>

预期结果:我期待评级栏没有右填充和底部填充。

最佳答案

你可以简单地调整这个

style="@android:style/Widget.DeviceDefault.RatingBar.Small"

代替
style="@style/Widget.AppCompat.RatingBar

关于java - 如何从 Android 的评级栏中删除填充?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54071037/

相关文章:

java - 为什么Windows桌面不广播UDP?

javascript - 是否可以检测网络应用程序上的 Android 后退按钮?

android - googleMap.getMyLocation();无法获取当前位置

Android布局<include/>标签

java - 本地 Tomcat 环境未启动

java - Java 中 JSmooth 中捆绑 JRE 的问题

android - 移除 ImageView 周围的白色边框

android - 使用滚动按钮时应用程序崩溃

java - 存储字符串且忽略字母大小写的数据结构

android - 在 Android 中进行下一步之前需要完成长任务时的正确设计