简体   繁体   English

是否可以制作包含SeekBar的主屏幕小部件?

[英]Is it possible to make a home-screen widget that contains a SeekBar?

A bit new to Android. Android的新功能。 I am trying to create a home-screen widget that lets you change ringtone or music volume, using the SeekBar View. 我正在尝试创建一个主屏幕小部件,该小部件可让您使用SeekBar视图更改铃声或音乐音量。

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. 我在http://developer.android.com/guide/topics/appwidgets/index.html上阅读小部件时,很惊讶地遇到“创建应用小部件布局”一节,其中说只有某些类可以由RemoteViews对象处理,因此只能在主屏幕小部件中使用这些对象。 The ProgressBar class is supported, but the documentation explicitly says descendant classes are not supported. 支持ProgressBar类,但文档明确指出不支持子孙类。

Since I am trying to create a SeekBar in my widget, which is a descendant of ProgressBar, is this impossible via RemoteViews? 由于我试图在小部件(它是ProgressBar的后代)中创建SeekBar,因此无法通过RemoteViews进行此操作吗? If so, is there another method to create widgets which does not rely on RemoteViews? 如果是这样,还有另一种不依赖于RemoteViews的创建窗口小部件的方法吗? Thanks in advance for any help. 在此先感谢您的帮助。

Since I am trying to create a SeekBar in my widget, which is a descendant of ProgressBar, is this impossible via RemoteViews? 由于我试图在小部件(它是ProgressBar的后代)中创建SeekBar,因此无法通过RemoteViews进行此操作吗?

Correct. 正确。

If so, is there another method to create widgets which does not rely on RemoteViews? 如果是这样,还有另一种不依赖于RemoteViews的创建窗口小部件的方法吗?

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. 不会。不过,您可以编写自己的主屏幕应用程序,并且可以在主屏幕上使用任何内容,因为它是您自己的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM