在评级栏图像之间的工件

时间:2012-10-28 15:17:21

标签: java android user-interface android-resources ratingbar

我在android中创建了我的自定义评级栏,但我在使用低级lvl API的设备上遇到了一些问题。 我成功地在一个带有ICS的htc上实现了它,但是对于Android 2.2的htc愿望我在图像之间有工件。 我为每个屏幕密度创建了png资源。

这是hdc屏幕的htc欲望图像: htc desire with artifacts

这是htc one x with xhdpi screen的图片: htc one x without artifacts

以下内容包含在我的布局文件中:      以下是我的可绘制资源:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+android:id/background"
          android:drawable="@drawable/bone_empty" />
    <item android:id="@+android:id/progress"
          android:drawable="@drawable/bone_full" />
</layer-list>

以下是我的res / values-hdpi / styles.xml(由htc欲望使用)

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="dogBar" parent="@android:style/Widget.RatingBar">
        <item name="android:progressDrawable">@drawable/dog_rating_bar</item>
        <item name="android:minHeight">48dp</item>
        <item name="android:maxHeight">48dp</item>
    </style>
</resources>

以下是我的res / values-xhdpi / styles.xml(由htc one x使用)

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="dogBar" parent="@android:style/Widget.RatingBar">
        <item name="android:progressDrawable">@drawable/dog_rating_bar</item>
        <item name="android:minHeight">64dp</item>
        <item name="android:maxHeight">64dp</item>
    </style>
</resources>

0 个答案:

没有答案
相关问题