GUI-GUIDER的文本框的不换行模式(One Line Mode)设置无效

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GUI-GUIDER的文本框的不换行模式(One Line Mode)设置无效

15,124件の閲覧回数
alen-liao
Contributor III

您好!

        GUI-GUIDER的文本框的不换行模式(One Line Mode)设置为ON,但在模拟运行时文本框Textarea还是显示了换行标志以及文本内容能上下拉动。

0 件の賞賛
返信
12 返答(返信)

15,060件の閲覧回数
alen-liao
Contributor III

文本框的不换行模式(One Line Mode)设置为ON后,文本框的显示不应该像2.png那样显示一个竖条,而且文本不应该能上下移动。

0 件の賞賛
返信

15,054件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @alen-liao,

 

This issue is caused by widget size and font size, if the font height is greater than widget size, the text area will be scrollable.

 

To avoid this issue please modify the widget height and padding,  or you can just add custom code to the screen to make the widget fit text size:

lv_obj_set_height(ui->screen_ta_1, LV_SIZE_CONTENT);

 

Hope it helps.

 

Best Regards,

Wenbin

0 件の賞賛
返信

15,022件の閲覧回数
alen-liao
Contributor III

为什么我在窗体加载函数里为每个文本框运行 一次lv_textarea_set_one_line(guider_ui.scrData_ta1, true)函数,文本框的蓝色光标竖条就没有了,而且文本也不能上下移动了?

0 件の賞賛
返信

15,013件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @alen-liao,

 

The lv_obj_set_size() function will overwrite size of lv_textarea_set_one_line(), so text area will be scrollable while the object height is smaller than text font height, but it's still in the one line mode since the text always keeping in one line.

If you call lv_textarea_set_one_line() after lv_obj_set_size() the object height will be overwrite by the text font height, which will cause inconsistent effect between editor and simulator/target.

Default:

WenbinYuan_0-1724987680666.png

call lv_textarea_set_one_line() at end:

WenbinYuan_1-1724987779176.png

 

We are trying  to make sure that the editor and the actual effect are consistent, and this is why I suggest you adjust widget size, padding and text font size to get a better result.

WenbinYuan_2-1724988492531.png

 

 

Best Regards,

Wenbin

 

0 件の賞賛
返信

14,992件の閲覧回数
alen-liao
Contributor III
请教,我设定了文本框的大小是154*52(lv_obj_set_size(ui->scrData_taITargetVal, 154, 52);)字体大小是28号(lv_font_SourceHanSansSC_Regular_28)但还是出现了蓝色竖条滑动条。请教文本框的大小与字体大小之间应该怎样设定比较合适?或者说他们之间有什么比例关系?谢谢!
0 件の賞賛
返信

14,981件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @alen-liao,

The content height of widget is mainly calculated by font actual size(normally greater than font size) and padding top & bottom values.

 

I have test your case in my side and the text area is working properly:

WenbinYuan_0-1725003788885.png

textarea size: 154X52

font size:  lv_font_SourceHanSerifSC_Regular_28

padding: 4, 4 ,4.

 

Best Regards,

Wenbin

 

 

0 件の賞賛
返信

14,873件の閲覧回数
alen-liao
Contributor III
请问label控件显示文字时,GUIDER是否为这个文本控件的顶部默认留空了?这个留空值在哪里修改的?
0 件の賞賛
返信

14,872件の閲覧回数
alen-liao
Contributor III
textarea控件的顶部留空可通过函数设定,但label不管怎么设置,顶部还是有留空,这是GUIDER默认的吗?
0 件の賞賛
返信

14,862件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @alen-liao,

 

When set all paddings to 0 the Label is same with Textarea in my side:

WenbinYuan_0-1725437175497.png

 

Best Regards,

Wenbin

0 件の賞賛
返信

14,864件の閲覧回数
alen-liao
Contributor III

图片中按钮上的文字我是用label显示的,但模拟运行时文字突出了按钮范围。这种现象在GUIDER1.72版本上是没有的。在1.8的版本却出现了。

0 件の賞賛
返信

14,820件の閲覧回数
alen-liao
Contributor III
使用GUIDE1.8版本新建一个工程测试,不会出现这个问题。但把一个V1.72版本的工程升级到V1.8就会出现。
0 件の賞賛
返信

15,077件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @alen-liao

 

Could you please provide more details about this issue? Because in my case the one line mode is work properly:

WenbinYuan_0-1724841234349.png

 

 

Best Regards,

Wenbin

0 件の賞賛
返信