【发布时间】:2014-02-25 19:10:54
【问题描述】:
我有以下代码:
Shoes.app title: "Add a person to database" do
stack do
title "Create a new person"
para "Enter their name:", :font => "MS UI Gothic"
@name = edit_line
para "Enter their age:", :font => "MS UI Gothic"
@age = edit_line
para "Enter their address:",:font => "MS UI Gothic"
@address = edit_line
para "Enter their mobile number:", :font => "MS UI Gothic"
@mob_number = edit_line
para "Enter their home number:", :font => "MS UI Gothic"
@home_number = edit_line
button "Add person to database" do
Person.new(@name, @age, @address, @mob_number, @home_number)
para newperson.details
end
end
end
我不想将每个元素的字体样式设置为“MS UI Gothic”,而是希望将应用程序中出现的所有文本的默认字体设置为 MS UI Gothic。我无法从我找到的任何教程中弄清楚如何做到这一点。有什么建议吗?
【问题讨论】:
-
我在他们的文档中也找不到关于全局样式的任何内容。奇怪,我希望会有这样的东西出现。至少您可以使用变量
para_style = { font: "MS UI Gothic" }并将其传递给每个段落。至少这使您可以集中样式定义,并仅在 1 个位置进行更改。不过,仍然是穷人的“解决方案”。