如何在Android小部件中设置RecyclerView [英] How to set RecyclerView in android widget
问题描述
来自: https://developer.android.com/training/material/listing-cards.html
我想在主屏幕的小部件中设置 RecyclerView
.是否可能,如果可以,怎么办?请给一些样品.
I want to set RecyclerView
in widget on home screen. Is it possible, and if it is, how to do it? Give some samples please.
推荐答案
不支持将RecyclerView用作RemoteView.请参见 CreatingLayout
RecyclerView is not supported to be used as a RemoteView. See CreatingLayout
RemoteViews对象(以及相应的App Widget)可以支持以下布局类:
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
FrameLayout
LinearLayout
RelativeLayout
GridLayout
FrameLayout
LinearLayout
RelativeLayout
GridLayout
以及以下窗口小部件类:
AnalogClock
按钮天文钟
ImageButton
ImageView
ProgressBar
TextView
ViewFlipper
ListView
GridView
StackView
AdapterViewFlipper
And the following widget classes:
AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView
ViewFlipper
ListView
GridView
StackView
AdapterViewFlipper
这篇关于如何在Android小部件中设置RecyclerView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!