【问题标题】:setting appearance of radiobutton as textarea in codename one将单选按钮的外观设置为代号一中的文本区域
【发布时间】:2012-07-18 17:09:49
【问题描述】:

我正在使用 codename one 构建一个应用程序

我有一个带有很长文本的单选按钮。

当我关注这个单选按钮时,该单选按钮的文本开始滚动。

我希望在屏幕上显示与单选按钮相关的所有文本。

所以我尝试了radiotbutton.setUIID("TextArea");

但是有了这个,只有单选按钮的外观会改变。单选按钮的文本不会溢出到多行。

我想一次全部显示单选按钮的文本(不管它有多长)。我该怎么做?

【问题讨论】:

    标签: lwuit codenameone


    【解决方案1】:

    MultiButton 有单选按钮模式,但需要提前知道行数。

    解决办法是这样的:

    RadioButton r = new RadioButton();
    Container c = new Container(new BoxLayout(new BoxLayout.X_AXIS));
    c.addComponent(r);
    TextArea radioText = new TextArea("Long text for radio button");
    radioText.setEditable(false);
    c.addComponent(radioText);
    radioText.setUIID("RadioButton");
    c.setLeadComponent(r);
    

    您可以在同样支持主要组件的 GUI 构建器中完成这一切。

    【讨论】:

      猜你喜欢
      • 2016-10-30
      • 2015-06-26
      • 2014-11-29
      • 1970-01-01
      • 2016-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多