Jump to content
Fórum Script Brasil
  • 0

MDExpansionPanel


phvbrito

Question

Boa tarde, pessoal vejam se alguém pode me dar uma força, já tentei de um tudo e não consego descobrir o que estou fazendo de errado, não consigo fazer os itens serem exibidos. este codigo sera modificado depois para exibir os itens finais, segue...

 

#TelaConsultaPro.py

from kivymd.uix.screen import MDScreen
from kivy.uix.screenmanager import SlideTransition
from kivymd.uix.expansionpanel import MDExpansionPanel, MDExpansionPanelThreeLine
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button

class TelaConsultaPro(MDScreen):
    
    def transicao_tela(self, tela):
        self.manager.transition = SlideTransition(direction="right")
        self.manager.current = tela

    def on_start(self):
    
        for i in range(10):
            panel = MDExpansionPanel(text="Painel " + str(i))
            content = BoxLayout(orientation="vertical")
            content.add_widget(Label(text="Conteúdo do painel " + str(i)))
            content.add_widget(Button(text="Botão " + str(i)))
            panel.content = content
            self.ids.box.add_widget(panel)
#TelaConsultaPro.kv

<TelaConsultaPro>:
    MDBoxLayout:
        orientation: 'vertical'

        MDTopAppBar:
            title: "Cadastro"
            left_action_items: [["menu", lambda x: app.callback()]]
            right_action_items: [["arrow-left", lambda x: root.transicao_tela("TelaPrincipal")]]
            elevation: 10
            md_bg_color: "#000000"
            specific_text_color: "white"

        MDScrollView:
            MDGridLayout:
                id: box
                cols: 1
                adaptive_height: True               
               
        MDTopAppBar:
            type: "bottom"
            mode: "free-end"
            elevation: 10
            md_bg_color: "#000000"

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.9k
×
×
  • Create New...