2017-08-02 59 views

回答

1

enter image description here

每個TabbedPanelItem具有其確定的標題文本屬性。 Label本身,TextInput,...沒有標題。

from kivy.app import App 
from kivy.lang import Builder 


kvstr = Builder.load_string(""" 
TabbedPanel: 
    do_default_tab: False 
    TabbedPanelItem: 
     text: "first heading" 
     BoxLayout: 
      Label: 
       text:"I am the Label in the first Tab" 
      Label: 
       text:"I am another Label in the first Tab" 
    TabbedPanelItem: 
     text: "second heading" 
     Label: 
      text:"I am the Label in the second Tab" 
""") 




class MyAppApp(App): 
    def build(self): 
     return kvstr 


if __name__ == '__main__': 
    MyAppApp().run() 
+0

假設TabeedPanel中有Label,TextInput,Button。有什麼方法可以在標籤,TextInput,按鈕中給出標題? – MXDel

+0

您可以將標籤中的某些文本加粗或將其與另一個標籤放在BoxLayout中。標題的概念並沒有真正意義,我在kivy也許更多地解釋你的意思是由 – PalimPalim

+0

的BoxLayout: 方向:「垂直」 標籤: 標記:真 文字:「[B]也許我是一個標題[/b]「 標籤: 文本:」我是第一個標籤中的另一個標籤「......這樣? – PalimPalim

相關問題