Android的定制等级栏图像的大小问题 [英] Android custom rating bar image size problem

查看:115
本文介绍了Android的定制等级栏图像的大小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫建立一个自定义的评价吧。随着科济里的文章帮助我创造了它。
但我有不同的图像缩放大小不同的屏幕类型的问题。
下面我提供的图像与在左我的自定义的评价吧,简单的ImageView到右侧的截图。
这是HVGA屏幕。

链接截​​图

如你所见,恒星评级酒吧和ImageView的都是一样的。

和从HVGA屏幕这张截图

另一个链接截图

Android的莫名其妙调整大小明星在我的RatingBar。有什么问题?!

下面是code

 <的RatingBar机器人:ID =@ + ID / rating_lunch的风格=@风格/ starRatingBar的android:layout_width =WRAP_CONTENT
                   机器人:layout_height =WRAP_CONTENT机器人:numStars =5机器人:stepSize的=1.0/>

下面那张风格:

 <样式名称=starRatingBar父=@安卓风格/ Widget.RatingBar>
    <项目名称=机器人:progressDrawable> @绘制/ progress_star_big< /项目>
    <项目名称=安卓了minHeight> 19px< /项目>
    <项目名称=安卓了maxHeight> 19px< /项目>
< /风格>


解决方案

问题解决了。当我加入

 <采用-SDK安卓的minSdkVersion =4
      机器人:targetSdkVersion =7/>

要清单文件,一切都变得好吧)

Iam building a custom rating bar. With help of kozyr's article i have created it. But i have an issue with different image scaling sizes for different screen types. Below i provide image with screenshots of my custom rating bar in the left, and simple imageview to the right. This is for HVGA screen.

link to screenshot

As you see, stars in rating bar and in the imageview are the same

And this screenshot from HVGA screen

another link to the screenshot

Android somehow resizes stars in my ratingbar. What is the problem?!!

Here is the code

<RatingBar android:id="@+id/rating_lunch" style="@style/starRatingBar" android:layout_width="wrap_content"
                   android:layout_height="wrap_content" android:numStars="5" android:stepSize="1.0"/>

Here goes the style:

<style name="starRatingBar" parent="@android:style/Widget.RatingBar">
    <item name="android:progressDrawable">@drawable/progress_star_big</item>
    <item name="android:minHeight">19px</item>
    <item name="android:maxHeight">19px</item>
</style>

解决方案

Problem solved. When i added

<uses-sdk android:minSdkVersion="4"
      android:targetSdkVersion="7"   />

to the manifest file everything became allright)

这篇关于Android的定制等级栏图像的大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆