Scrollable TextView in Android Widget

前端 未结 4 1287
刺人心
刺人心 2021-01-15 05:34

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

The solutions given to this question Making TextView scrollable on Android cannot be applied be

相关标签:
4条回答
  • 2021-01-15 05:50

    I solved this problem by putting the text view inside ListView with single node, which is supported in App widget.

    http://developer.android.com/guide/topics/appwidgets/index.html#collections

    0 讨论(0)
  • 2021-01-15 05:56

    It looks like this is not possible.

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

    and here: How to make a scrollable app widget?

    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.

    0 讨论(0)
  • 2021-01-15 05:57

    I have been working on this with two buttons which increment and decrement through an array. Just having trouble accessing the global variables. Did you make any headway on this?

    0 讨论(0)
  • 2021-01-15 06:09

    In mainactivity.java:

    after code text view:

    TextView txt = (TextView) findViewById(R.id.textView id);
    

    Enter this code:

    txt.setMovementMethod(new ScrollingMovementMethod());
    

    and you will be ok.

    0 讨论(0)
提交回复
热议问题