【问题标题】:Unable to change the font family in GXT text Area无法更改 GXT 文本区域中的字体系列
【发布时间】:2017-11-10 01:11:43
【问题描述】:

我无法更改 GXT 文本区域的默认字体系列。我尝试过使用 StyleInjector 和 CSS。但它没有得到更新。你能帮帮我吗?

TextArea textArea = new TextArea();
textArea.setStyleName("gxtTextArea");

在 CSS 文件中,我给出了,

.gxtTextArea {
    font-family: Arial !important; 
    /* color: red !important;
    font-size: 24px !important;
    font-style: bold !important;        
    font-weight: bold !important; */
} 

【问题讨论】:

  • 如果你能提供一个小提琴,我很确定我可以帮助你;)
  • 您使用的是哪个版本的 GXT?

标签: java html css gwt gxt


【解决方案1】:

您也可以使用 addStyleName 代替 setStyleName。

TextArea textArea = new TextArea();
textArea.addStyleName("gxtTextArea");

在 CSS 方面,将其更改如下。

.gxtTextArea * {
    font-family: Arial !important; 
    /* color: red !important;
    font-size: 24px !important;
    font-style: bold !important;        
    font-weight: bold !important; */
 } 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多