在Android部件TextView的滚动部件、Android、TextView

2023-09-06 22:28:20 作者:与你

我想创建一个Android窗口小部件可滚动的TextView。

I would like to create an android widget with a scrollable textview.

对此问题的解决方案 制作的TextView滚动Android中 不能应用,因为它是一个小窗口:

The solutions given to this question Making TextView Scrollable in Android cannot be applied because it is a widget:

1。 这

 findViewById(R.id.textview).setMovementMethod(new MovementMethod());

不起作用,因为 findViewById 不可用 AppWidgetProvider 但只有在活动

2.Putting一个滚动型围绕的TextView 也不起作用,因为我得到一个 InflateException

2.Putting a ScrollView around the TextView also does not work, because I get an InflateException:

 android.view.InflateException: Binary XML file line #23: Error inflating class ScrollView

任何人都可以给我一个提示,如何使一个的TextView 在一个Widget滚动?

Can anybody give me a hint, how to make a TextView in a Widget scrollable?

推荐答案

看起来这是不可能的。

It looks like this is not possible.

更多关于这可以在这里找到: HTTP:/ /$c$c.google.com/p/android/issues/detail?id=9580

More on this can be found here: http://code.google.com/p/android/issues/detail?id=9580

在这里: http://stackoverflow.com/questions/2922114/how-to-make-a-scrollable-app-widget

所以,大概也可以做使appwidgets在HTC感环境滚动而不是正常的Andr​​oid环境。

So, probably it is possible to do make appwidgets scrollable in the HTC sense environment but not for normal android environments.

解决的办法是添加去向上和向下的列表按钮。

A way around this is to add buttons that go up and down in a list.

 
精彩推荐