您好!
GUI-GUIDER的文本框的不换行模式(One Line Mode)设置为ON,但在模拟运行时文本框Textarea还是显示了换行标志以及文本内容能上下拉动。
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
为什么我在窗体加载函数里为每个文本框运行 一次lv_textarea_set_one_line(guider_ui.scrData_ta1, true)函数,文本框的蓝色光标竖条就没有了,而且文本也不能上下移动了?
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:
call lv_textarea_set_one_line() at end:
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.
Best Regards,
Wenbin
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:
textarea size: 154X52
font size: lv_font_SourceHanSerifSC_Regular_28
padding: 4, 4 ,4.
Best Regards,
Wenbin
Hi @alen-liao,
When set all paddings to 0 the Label is same with Textarea in my side:
Best Regards,
Wenbin
Hi @alen-liao,
Could you please provide more details about this issue? Because in my case the one line mode is work properly:
Best Regards,
Wenbin