Is there a text newline in the GUI Guider imgbtn widget?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Is there a text newline in the GUI Guider imgbtn widget?

跳至解决方案
1,477 次查看
seobi1111
Contributor III

Hello

I am developing using MIMXRT1170-EVK and GUI Guider.

The GUI Guider version is as follows.

 

   - GUI Guider : v1.7.0

 

I Want to display text in 2 lines in the imgbtn widget.

Please answer about my question.

0 项奖励
回复
1 解答
1,438 次查看
seobi1111
Contributor III

Hi~ EdwinHz

Thanks for your reply.

It's not in the GUI Guider widget properties, but I modified it in the code as you mentioned and it works fine.

Thank you again.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,450 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @seobi1111,

To add text to a button, one should call the lv_label_set_text() function. For a "normal" button, like this, when adding text in two different lines like this, the generated function is as follows:

EdwinHz_0-1707952251978.png

lv_label_set_text(ui->screen_btn_1_label, "1st line\n2nd line");

 

For the imgbtn widget, the textbox under "Attribute" in GUI Guider does not allow you to add line breaks, but you should be able to edit the lv_label_set_text() function that corresponds to the imgbtn widget and add a "\n" manually to see a line break on the imgbtn.

I hope this helps,
Edwin.

 

0 项奖励
回复
1,439 次查看
seobi1111
Contributor III

Hi~ EdwinHz

Thanks for your reply.

It's not in the GUI Guider widget properties, but I modified it in the code as you mentioned and it works fine.

Thank you again.

0 项奖励
回复