如何设置安卓进度的高度? [英] How to set the Android progressbar's height?

查看:133
本文介绍了如何设置安卓进度的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 activity_main.xml 小于,你看,高度设为40畅游。     

My activity_main.xml is below, as you see, the height is set 40 dip.

和在MyEclipse中,它看起来象下面这样:

And in MyEclipse, it looks like below:

但是,当我在我的手机上运行它,它看起来像如下:

But when I run it on my phone, it looks like below:

所以我的问题是,为什么进度的实际高度是不是那个我设置?如何提高进度的高度?

So my question is why the real height of the progressbar is not the one I set? How to increase the height of the progressbar?

推荐答案

从<一个href="http://www.tutomobile.fr/realiser-une-progressbar-seekbar-personnalisee-sur-android-tutoriel-android-n%C2%B024/10/02/2011/">this教程:

<style name="CustomProgressBarHorizontal" parent="android:Widget.ProgressBar.Horizontal">
      <item name="android:progressDrawable">@drawable/custom_progress_bar_horizontal</item>
      <item name="android:minHeight">10dip</item>
      <item name="android:maxHeight">20dip</item>
</style>

然后简单地套用样式的进度条或更好,覆盖默认风格在你的主题为自动样式所有的应用程序的进度条。

Then simply apply the style to your progress bars or better, override the default style in your theme to style all of your app's progress bars automatically.

您所看到的截图不同的是,因为手机/仿真器使用的是不同的Andr​​oid版本(最新的从ICS(全息主题),上面是原来的主题)。

The difference you are seeing in the screenshots is because the phones/emulators are using a difference Android version (latest is the theme from ICS (Holo), top is the original theme).

这篇关于如何设置安卓进度的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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