Displaying Two RecycleView Widgets Side By Side With Kivy 2.1

Viewed 19

I am not too sure as to why I cant display two recycleview widgets side by side within a grid layout or box layout. Anyone have any ideas as to why ? I tried placing them within a boxlayout, gridlayout, and scatter but I can only get Step1 to appear. I tried adjusting the default size hint as well as a couple other parameters within the kv file. Do you think it has something to do with the screen manager. I am trying to really keep most of the display stuff within the kv file if possible. Do you think I should place it within the root widget on the python side of things?

Thanks !

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.pagelayout import PageLayout
from kivy.uix.recycleview import RecycleView
from kivy.uix.screenmanager import ScreenManager, Screen
#from kivy.uix.listview import ListView
import barcode as bc


class Step1(RecycleView):
    def __init__(self, **kwargs):
        super(Step1, self).__init__(**kwargs)
        self.data = [{'text': str(d)} for d in bc.step_one_display()]

class Step2(RecycleView):
    def __init__(self, **kwargs):
        super(Step2, self).__init__(**kwargs)
        self.data = [{'text': str(d)} for d in bc.step_two_display()]

class KVBL(Screen): #Root Wiget
    pass

class Setting_Page(Screen):
    pass

class KivyOne(App):
    def build(self):
        sm = ScreenManager()
        sm.add_widget(KVBL(name='Main Screen'))
        sm.add_widget(Setting_Page(name='Setting Page'))
        return sm

KivyOne().run()

kv file

<Step1>:
    viewclass: 'Label'
    RecycleBoxLayout:
        default_size: None, dp(30)
        default_size_hint: 1, None
        size_hint_y: None
        height: self.minimum_height
        orientation: 'vertical'

<Step2>:
    viewclass: 'Label'
    RecycleBoxLayout:
        default_size: None, dp(30)
        default_size_hint: 1, None
        size_hint_y: None
        height: self.minimum_height
        orientation: 'vertical'

<KVBL>:
    GridLayout:
        cols:2

        Step1:

        Step2:


<Setting_Page>
    GridLayout:
        cols: 2
        Step1:
        GridLayout:
            cols:1
            Button:
                text: 'Move to Origin'
1 Answers

Yeah I am dumb there was not any data in step2 and I changed default_size_hint: 0.5, None. that worked well.

Thanks for the feedback !

Related