安卓:帮助与小部件,显示新闻 [英] Android: Help with widget that shows news
问题描述
我想开发一个Android小工具中要显示的最新消息,但只有一次。要查看下一篇文章的用户可以preSS箭头按钮。
I am trying to develop an android widget that should show the latest news, but only one at a time. To see the next post the user could press arrow buttons.
我希望它看起来是这样的:
I want it to look something like this:
我应该使用什么控制这??
What control should I use for this??
推荐答案
,你可以在一个窗口小部件使用(至少在今天,可能在将来改变)的控制是有限的:
The controls that you can use in a widget(at least today, may change in future) are limited to:
一个RemoteViews对象(,因此,应用程序的Widget),可以支持以下布局类:
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
http://developer.android.com/guide/topics/appwidgets/ index.html的
* FrameLayout
* LinearLayout
* RelativeLayout
和下面的小部件类:
* AnalogClock
* Button
* Chronometer
* ImageButton
* ImageView
* ProgressBar
* TextView
所以,我会作出一个图像(或更多,如果你支持不同的屏幕上,你应该),并将它们添加到您的项目。然后,我会用ImageButton的,这是一个支持的控制。
So I would have made an image(or more if you support different screens as you should) and add them to your project. Then I would use imagebutton, which is a supported control.
这篇关于安卓:帮助与小部件,显示新闻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!