How to set RecyclerView in android widget(如何在 android 小部件中设置 RecyclerView)
问题描述
来自:https://developer.android.com/training/material/列表卡片.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
以及以下小部件类:
模拟时钟
按钮天文台表
图像按钮
图像视图
进度条
文本视图
ViewFlipper
列表视图
网格视图
堆栈视图
AdapterViewFlipper
And the following widget classes:
AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView
ViewFlipper
ListView
GridView
StackView
AdapterViewFlipper
这篇关于如何在 android 小部件中设置 RecyclerView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 android 小部件中设置 RecyclerView
基础教程推荐
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
