在Android部件TextView的滚动 [英] Scrollable TextView in Android Widget

查看:116
本文介绍了在Android部件TextView的滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个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

在这里: <一href="http://stackoverflow.com/questions/2922114/how-to-make-a-scrollable-app-widget">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.

这篇关于在Android部件TextView的滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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