【发布时间】:2016-02-19 04:49:15
【问题描述】:
我正在尝试创建一个在 .kv 文件中显示 3 个带有自定义类的按钮的 kv:但在应用程序中有 3 个没有颜色和文本的按钮
SimpleKivy.kv:
<Buttond@Button>:
color: 0,0,1,0
<Layoutt>:
Buttond:
size: 100, 100
pos: 350,150
text: "sdciao"
Buttond:
size: 100, 100
pos: 250,150
text: "sciao"
Buttond:
size: 100, 100
pos: 100,150
text: "dsciao"
这里是prova.py:
import kivy
kivy.require("1.9.0")
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
class Layoutt(GridLayout):
class SimpleKivy(App):
def build(self):
return Layoutt()
SimpleKivy().run()
编辑: 使用 color:0,0,1 文本出现,但它不想改变颜色
【问题讨论】:
-
抱歉,问题出在使用的数字上,0,0,0,0 我认为它是黑色的,所以在按钮上看不到(黑色背景)