Android: Help with widget that shows news

半城伤御伤魂 提交于 2019-12-23 05:22: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.



来源:https://stackoverflow.com/questions/4430701/android-help-with-widget-that-shows-news

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!