Android: Help with widget that shows news

2019-06-12 03:34发布

问题:

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??

回答1:

The controls that you can use in a widget(at least today, may change in future) are limited to:

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

And the following widget classes:

* AnalogClock
* Button
* Chronometer
* ImageButton
* ImageView
* ProgressBar
* TextView

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.