java textarea 大小_textArea字体大小的变化会产生意外结果

我有一个textArea,当字体较大时占据整个屏幕 . 但是如果字体较小,则会留下很大的空间 . textArea有margin,padding为零 . 在模拟器和真实设备中都可以看到这个问题(我在Android设备上检查过) .

Form hi = new Form("Hi World", new BorderLayout());

hi.show();

TextArea priceLabel = new TextArea("AG and Company works in Nepal for manufacturing, marketing and exporting herbal products and organic argo products. The products include organic coffee, spices, body care products, crude herbs, cosmetic products, and vegetable oil and herbal teas. The organization is located in Sinamangal, Kathmandu and the chairman is Mr.Sitaram Adhikari.");

priceLabel.setUIID("small");

priceLabel.getAllStyles().setMarginLeft(1);

priceLabel.setEditable(false);

priceLabel.setGrowByContent(true);

priceLabel.setFocusable(false);

priceLabel.setScrollVisible(false);

priceLabel.getAllStyles().setBgColor(0xff0000);

priceLabel.getAllStyles().setBgTransparency(255);

priceLabel.getAllStyles().setMargin(0,0,0,0);

priceLabel.getAllStyles().setPadding(0,0,0,0);

Container herbDetailContainer = BoxLayout.encloseY(new Label(), priceLabel);

herbDetailContainer.setScrollableY(true);

hi.add(BorderLayout.CENTER, herbDetailContainer);

hi.revalidate();

字体大小1毫米(原生:MainThin)

9f574ed94ccb788766e44f82e8fcaa85.png

字体大小2毫米(原生:MainThin)

0bdf4c2d3c864fc6b52ed89dd7a81e1d.png

字体大小3毫米(原生:MainThin)

179dcab8e37f8498b96dca5a36aebeef.png

字体大小4毫米(原生:MainThin)

0919e4bd6f31c6e0ffe466cadb89533e.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值