Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Horizonally Scrolling TextView
-
Is it possible to create a TextView that Will scroll from left to right in the Ui module? It seems there is no way to prevent the text wrapping.
I've tried wrapping the TextView within a ScrollView and allowing the TextView to scale to its contents, but it never seemed to work, and I've been unable to find examples of either within the documentation.
-
Do you have some minimal implementation code that we can stare at? In general, you need to make sure that the width of the ScrollView frame is larger than the width of the TextView frame.
-
@ccc I don't think he's trying to get a TextView to move around within a scroll view. I think he's trying to imitate the default vertical-scrolling behavior of a TextView, only horizontally.
-
-
# coding: utf-8 import ui v=ui.load_view('ScriptUIBehaviorTest') outText=('*'*5000 + '\n') * 3 v['scrollview1'].border_width=3 v['scrollview1'].height=378 v['scrollview1'].width=378 tView = v['scrollview1']['textview1'] tView.text = outText tView.width=10000 v.present()
I created a scrollview with a textview inside in the UI editor.
Rather than the text in the TextView extending past the scrollview borders and being able to scroll sideways, it simply wraps around at the borders of the scrollview.
-
Did you look at ccc's link? He shows how to set content size of the scrollview, and width of the textview. The key is that you are creating a textview wider than the scrollview width, and the scrollview content_width also must be wider than the scrollview width.