对于 Android 来说有点陌生。我正在尝试创建一个主屏幕小部件,让您使用 SeekBar 视图更改铃声或音乐音量。
我正在阅读 http://developer.android.com/guide/topics/appwidgets/index.html,并惊讶地发现了一个部分, “创建应用程序小部件布局”,表示只有某些类可以由 RemoteViews 对象处理,因此只有这些类可以在主屏幕小部件中使用。支持 ProgressBar 类,但文档明确表示不支持后代类。
由于我试图在我的小部件中创建一个 SeekBar(它是 ProgressBar 的后代),因此通过 RemoteViews 这不可能吗?如果是这样,是否有另一种方法来创建不依赖 RemoteViews 的小部件?预先感谢您的任何帮助。
A bit new to Android. I am trying to create a home-screen widget that lets you change ringtone or music volume, using the SeekBar View.
I was reading on widgets in http://developer.android.com/guide/topics/appwidgets/index.html, and was surprised to come across a section, "Creating the App Widget Layout," that says only certain classes can be handled by a RemoteViews object, and thus only these can be used in a home-screen widget. The ProgressBar class is supported, but the documentation explicitly says descendant classes are not supported.
Since I am trying to create a SeekBar in my widget, which is a descendant of ProgressBar, is this impossible via RemoteViews? If so, is there another method to create widgets which does not rely on RemoteViews? Thanks in advance for any help.
发布评论
评论(1)
正确的。
不。不过,您可以编写自己的主屏幕应用程序,并且可以在主屏幕上使用您想要的任何内容,因为它是您自己的应用程序。
Correct.
No. You can write your own home screen app, though, and there you can use whatever you want on the home screen, since it is your own app.