如何将图标添加到 BlackBerry 应用程序的标题栏?
我正在使用 BlackBerry Java API(操作系统 4.7 及更高版本)用 Java 编写 BlackBerry 应用程序。我想在我的应用程序的标题行添加一个图标。 API文档说“MainScreen”类的方法“setTitle”需要一个“Field”,所以我想我可以创建一个包含图标(BitmapField)和一些文本(LabelField)的“HorizontalFieldManager”。然而,当我这样做时,我遇到了一个奇怪的异常。是否可以使用任何字段(除 LabelField 之外)作为 setTitle()?我看到其他应用程序的标题行中有图标,但也许他们没有使用 setTitle() 而是创建自己的(假)标题行。
I'm writing a BlackBerry app in Java using the BlackBerry Java API (OS 4.7 and above). I would like to add an icon to the title row of my app. The API documentation says that the method "setTitle" of the "MainScreen" class takes a "Field", so I thought I could just create a "HorizontalFieldManager" that contains an icon (BitmapField) and some text (LabelField). However when I do that I get a weird exception. Is it possible at all to use any field (other than LabelField) for setTitle()?. I've seen that other apps have icons in their title row, but maybe they're not using setTitle() but create their own (fake) title row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了。我不知道我之前做错了什么,但这就是它的工作原理,正如我在最初的问题中所描述的那样:
I already solved it. I don't know what I did wrong previously, but this is how it works as I described it in the initial question: