为什么我应该将RemoteViews用于Android主屏幕小部件? [英] Why should I use RemoteViews for Android home screen widgets?

查看:60
本文介绍了为什么我应该将RemoteViews用于Android主屏幕小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现一个Android主屏幕小部件.我想知道为什么我应该在实现小部件时使用RemoteViews?

I'm trying to realize an Android home screen widget. I am interested to know why I should use RemoteViews in implementing widgets?

推荐答案

请参阅此链接站点.

如果您熟悉以XML声明布局,则创建App Widget布局非常简单.但是,您必须注意,App Widget布局基于RemoteView,并不支持每种布局或视图Widget.

Creating the App Widget layout is simple if you're familiar with Declaring Layout in XML. However, you must be aware that App Widget layouts are based on RemoteViews, which do not support every kind of layout or view widget.

RemoteViews对象(因此是一个App Widget)可以支持以下布局类:

A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:

FrameLayout
LinearLayout
RelativeLayout

以及以下窗口小部件类:

And the following widget classes:

AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView

不支持这些类的后代.

这篇关于为什么我应该将RemoteViews用于Android主屏幕小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆