显示毫秒与Android天文台表 [英] Show milliseconds with Android Chronometer

查看:136
本文介绍了显示毫秒与Android天文台表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法,使天文台在安卓(preferably 1.6及以上)的第二递增计数时十分之秀

是否有可能这样做吗?如果没有,是否有一个免费的(和preferably开放源代码)库,做同样的?如果做不到这一点,我会写我自己,但我宁愿用别人的!

解决方案
  

是否有可能这样做吗?

不是真的。你可以传递一个格式字符串,显示十分之一秒,但天文台表本身只更新每一秒。更新频率烘焙到code。

  

如果不是,是否有一个免费的(和   preferably开放源代码)库   不一样的吗?

的<一个href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/Chronometer.java;h=7e667224656549b0eed105b188190de69885ad0c;hb=HEAD"相对=nofollow> 天文台表源是Apache许可证2.0下,所以你可以修改它来满足。找到所有出现1000 并将其更改为 100 ,你很可能大部分存在的方式。

记住,这个天文台表可以在活动中使用,但不是一个应用程序窗口小部件,因为定制查看类不通过该应用插件框架支撑

I'm looking for a way to make the Chronometer in Android (preferably 1.6 and upwards) show 10ths of a second while counting up.

Is it possible to do this? If not, is there a free (and preferably open source) library that does the same? Failing that I'll write my own, but I'd rather use someone else's!

解决方案

Is it possible to do this?

Not really. You could pass a format string that shows tenths of a second, but the Chronometer itself only updates every second. The update frequency is baked into the code.

If not, is there a free (and preferably open source) library that does the same?

The Chronometer source is available under the Apache License 2.0, so you can modify it to suit. Find all occurrences of 1000 and change them to 100, and you're probably most of the way there.

Bear in mind that this Chronometer can be used in an activity but not an app widget, since customized View classes are not supported by the app widget framework.

这篇关于显示毫秒与Android天文台表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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