2

I am trying to create a text field where I can display codes and snippets without wrapping text instead I want the text to scroll text along both x and y axis. I am trying to use following code but can't do that

ScrollView:
    CodeInput:
        text:"abc"*30
        scroll_x: True
Manohar
  • 126
  • 1
  • 9
  • Have a look at the [ScrollView Documentation](https://kivy.org/doc/stable/api-kivy.uix.scrollview.html#module-kivy.uix.scrollview). – John Anderson Mar 03 '21 at 15:23

1 Answers1

2
from kivy.lang import Builder
from kivymd.app import MDApp


KV = '''
Screen:
    ScrollView:
        id: scroll
        CodeInput:
            size_hint: 1, None
            text: "abc"*3000
            height: max(self.minimum_height, scroll.height)
'''


class MainApp(MDApp):
    def build(self):
        return Builder.load_string(KV)


MainApp().run()
Ne1zvestnyj
  • 1,391
  • 1
  • 7
  • 25
  • Thanks this was also a problem. But I also want to scroll my code along x axis unlike stack overflow where we can add code without wrapping lines so that it's easy to understand code. Can you THANKS FOR YOUR HELP – Manohar Mar 11 '21 at 06:23