Can anyone tell me what views can I use in an appWidget?
Thank you!
according to the official android API:
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
- FrameLayout
- LinearLayout
- RelativeLayout
- GridLayout
And the following widget classes:
- AnalogClock
- Button
- Chronometer
- ImageButton
- ImageView
- ProgressBar
- TextView
- ViewFlipper
- ListView
- GridView
- StackView
- AdapterViewFlipper
Descendants of these classes are not supported.
RemoteViews also supports ViewStub, which is an invisible, zero-sized View you can use to lazily inflate layout resources at runtime.
Also starting with android 3.0 the next views are supported:
- ListView - A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.
- GridView - A view that shows items in two-dimensional scrolling grid. For an example, see the Bookmarks app widget.
- StackView - A stacked card view (kind of like a rolodex), where the user can flick the front card up/down to see the previous/next card, respectively. Examples include the YouTube and Books app widgets.
- AdapterViewFlipper - An adapter-backed simple ViewAnimator that animates between two or more views. Only one child is shown at a time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With