如何获取当前黑莓主题的突出显示颜色?
我已经实现了一些自定义字段,并希望保持外观与当前的 Blackberry 主题一致。因此,我希望字段的突出显示颜色与 BB 应用程序中使用的突出显示颜色保持一致。
我怎样才能得到这个颜色?
编辑:显然,有无法从任何 API 获取这些颜色。那么有没有一种变通的方法来获得这些颜色呢?
I've implemented some custom fields and would like to keep the look-and-feel consistent with the current Blackberry theme. So I would like the highlighting color of the fields to be consistent with the highlight color used throughout the BB apps.
How can I get the this color?
Edit: Apparently, there's no way to get those kinds of colors from any API. So is there a work-around way to getting these colors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们可以做的是测试一些自定义文本字段的drawFocus方法的颜色:
并在屏幕上使用它:
颜色测试应用截图http://img188.imageshack.us/img188/8943/830001.png
What we can do is test colors on drawFocus method of some custom text field:
And use it on the screen:
color test app screenshot http://img188.imageshack.us/img188/8943/830001.png
这工作正常,但有一个问题。该应用程序必须经过签名,并且会向用户显示一条确认信息以拍摄屏幕截图,例如“应用程序 xxx 想要拍摄屏幕截图。允许吗?”这可能会让用户烦恼。这是由于在设备类中使用安全 API 造成的。
相反,尝试从
位图
创建新的图形
,然后在其上绘图。This works fine but there is a problem. The application must be signed and it displays a confirmation to the user to take the screen shots like "Application xxx wants to take a screen shot. Allow?" This could be annoying to the user. This is caused by using a secure API in the device class.
Instead, try creating a new
Graphics
from aBitmap
, then draw on it.