【发布时间】:2011-06-14 22:45:27
【问题描述】:
我按照此处的说明实现了自定义评分栏
How to create Custom Ratings bar in Android
但是当我尝试制作评分栏的 minHeight
虽然我想制作这种尺寸的评分栏
我是否必须根据评分栏的最大和最小高度调整我在可绘制中使用的图像的大小?
【问题讨论】:
标签: android
我按照此处的说明实现了自定义评分栏
How to create Custom Ratings bar in Android
但是当我尝试制作评分栏的 minHeight
虽然我想制作这种尺寸的评分栏
我是否必须根据评分栏的最大和最小高度调整我在可绘制中使用的图像的大小?
【问题讨论】:
标签: android
问题可能与屏幕分辨率有关。尝试将其添加到您的清单文件中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.main" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true"
android:normalScreens="true" android:largeScreens="true"
android:anyDensity="true" />
...
更多信息在这里:http://www.jdamcd.com/?p=303
你也可以尝试设置style="?android:attr/ratingBarStyleSmall
【讨论】:
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" /> 如果你愿意,可以尝试在你的布局 xml 文件中设置 style="?android:attr/ratingBarStyleSmall。
<RatingBar android:id="@+id/ratingBar" style="?android:attr/ratingBarStyleSmall" android:layout_gravity="center_vertical|center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"></RatingBar>