扩展的LinearLayout为App的Widget [英] Extend LinearLayout for App Widget

查看:271
本文介绍了扩展的LinearLayout为App的Widget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我扩展的LinearLayout类来创建自己的自定义布局。

I extended the LinearLayout class to create my own custom layout.

它工作得很好,当我把它放在一个活动,但是当我把在appwidget我得到:

It works well when I put it on an Activity, but when I put in an appwidget I get:

02-11 13:16:36.906:W / AppWidgetHostView(6138):错误夸大AppWidget AppWidgetProviderInfo(供应商= {ComponentInfo COM / com.Provider}):android.view.InflateException:二进制XML文件行#2:错误充气类com.CustomLinaerLayout

02-11 13:16:36.906: W/AppWidgetHostView(6138): Error inflating AppWidget AppWidgetProviderInfo(provider=ComponentInfo{com/com.Provider}): android.view.InflateException: Binary XML file line #2: Error inflating class com.CustomLinaerLayout

有没有把一个自定义布局上appwidget的方式?

Is there a way to put a custom layout on an appwidget?

感谢。

推荐答案

从这里拍摄的 http://developer.android.com/guide/topics/appwidgets/index.html

一个RemoteViews对象(,因此,应用程序的Widget),可以支持以下布局类:

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

FrameLayout
LinearLayout
RelativeLayout

和下面的小部件类:

AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView
ViewFlipper
ListView
GridView
StackView
AdapterViewFlipper

这些类的后代不被支持。

这篇关于扩展的LinearLayout为App的Widget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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