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
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