Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道您可以使用新行创建一个新行,<html> <br> </html>但是当我将变量(是字符串类型)添加到标签的文本时,此命令不再起作用。
<html> <br> </html>
label.setText("blahblahblah" + variable + "<html><br>blahblahblah</html>");
我需要它输出:
啦啦啦啦啦啦 啦啦
您需要将<html>标签作为字符串中的第一件事:
<html>
label.setText("<html>blahblahblah" + variable + "<br>blahblahblah</html>");
它应该是: