【发布时间】:2020-08-01 08:11:31
【问题描述】:
我一直无法找到更改 kivy 回收箱字体颜色的方法。如何更改标签属性?下面是我的代码。
Python 方面:
class ExampleViewer(RecycleView):
def __init__(self, **kwargs):
super(ExampleViewer, self).__init__(**kwargs)
self.data = [{'text': f"[color=[0,0,0,1]]{x}[/color]"} for x in range(20)]
基维边:
ExampleViewer:
viewclass: 'Label' # defines the viewtype for the data items.
orientation: "vertical"
RecycleBoxLayout:
color: (0, 0, 0, 1)
default_size: None, dp(56)
markup: True
# defines the size of the widget in reference to width and height
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
我尝试为标签创建标记并直接更改颜色。这两种方法都不适合我。有办法改吗?
【问题讨论】: