有没有办法将 EditText/输入字段放入主屏幕小部件?

Is there any way to put an EditText/input field into a homescreen widget?(有没有办法将 EditText/输入字段放入主屏幕小部件?)

本文介绍了有没有办法将 EditText/输入字段放入主屏幕小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的用户在主屏幕上输入一些内容,但每次我向小部件添加 Edittext 时它都会中断.我做了一些谷歌搜索,发现小部件显然不支持它们.不过,每部 Android 手机上都有一个带有输入字段的 Google 搜索小部件,所以我想知道是否有任何方法可以在我的小部件中添加一个.

I want my user to input something on the homescreen, but every time I add an Edittext to the widget it breaks. I did a little google searching to find that they apparently are not supported in widgets. There is a Google Search widget with an input field on every android phone though, so I am wondering if there is any way to have one in my widget.

提前致谢

我注意到 Google 搜索栏实际上并没有输入,它只是在触摸时打开一个活动.但是还有其他应用,例如 FriendStream,它们的小部件具有输入部分.

I noticed that the Google search bar doesn't actually have an input, instead it just opens an activity on touch. But there are still other apps like FriendStream which have input parts of their widgets.

推荐答案

FriendStream 可以做到,因为它使用了修改后的 Sense 主屏幕.它还启用了自 3.0 (Honeycomb) 及更高版本以来只能在普通"Android 上进行的滚动.

FriendStream can do it because it uses the modified Sense homescreens. It also enables scrolling that is only possible on "stock" Android since 3.0 (Honeycomb) and above.

继续:

  • Sense:至少从 1.5 开始启用(我认为之前)在任何 Android 版本的主屏幕上输入和滚动

  • Sense: Enables since 1.5 at least (and i think before) input and scroll on any Android version homescreens

Android 3.0:开始支持部分 Sense 功能,例如在主屏幕上滚动但仍无法输入

Android 3.0: Started supporting some of the Sense features, for example scroll on home screen but still not input

因此,您可以通过主屏幕上的 edittext(或类似的方式)添加输入,但只能在 HTC Sense 手机上.

So, you can probably add input via edittext on homescrens (or somethink like it) but ONLY on HTC Sense phones.

虽然我认为这不是一个好主意,但这已经是你的选择:-)

I don't think that's a good ideia though, but that's already your choice :-)

这篇关于有没有办法将 EditText/输入字段放入主屏幕小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:有没有办法将 EditText/输入字段放入主屏幕小部件?

基础教程推荐