2017-08-02 61 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

相关问题