Labels cannot be scaled up and down (Gui Guide 1.9.1, LVGL 8.3.10)

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

Labels cannot be scaled up and down (Gui Guide 1.9.1, LVGL 8.3.10)

ソリューションへジャンプ
249件の閲覧回数
zhuangfei
Contributor II

Hi: 

Recently, I encountered a problem in the process of using:

I created a label, and then triggered the event to enlarge or shrink another label, and then simulate was not successful. When the label was pressed, the other label did not respond.

Four interface functions are used: lv_obj_set_style_transform_pivot_x(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_pivot_y(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_width(item_array_1a[i].item_obj_icon, 512, LV_PART_MAIN);
lv_obj_set_style_transform_height(item_array_1a[i].item_obj_icon, 128, LV_PART_MAIN);

so, why labels cannot be scaled up and down? Is the LVGL interface used incorrectly?

图像1.png图像2.png

 

タグ(2)
0 件の賞賛
返信
1 解決策
95件の閲覧回数
zhuangfei
Contributor II
The V8.3.10 version of the interface has a problem, the V9.2.1 version of the interface can achieve the function:
lv_obj_set_style_transform_pivot_x(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_pivot_y(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_scale_x(item_array_1a[i].item_obj_icon,384,LV_PART_MAIN);
lv_obj_set_style_transform_scale_y(item_array_1a[i].item_obj_icon,384,LV_PART_MAIN);

Thanks to wenbin

元の投稿で解決策を見る

5 返答(返信)
216件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @zhuangfei,

Could you please check whether the LV_OBJ_FLAG_CLICKABLE flag has been added to your trigger label widget? By default, label widgets do not have this flag enabled, so they won’t respond to click events unless it’s explicitly set.

You can add the flag in the widget’s Flags section like this:

WenbinYuan_2-1758189869524.png

Hope this helps! Feel free to share more details or let us know if you need further assistance.

 

Best Regards,

Wenbin 

 

0 件の賞賛
返信
209件の閲覧回数
zhuangfei
Contributor II

hi:@Wenbin

I added flag: add clickable according to your screenshot, but there was still no reaction. For other keys, I set the trigger event to change the color of the background image of the label when clicked. This can be achieved, but the zoom and zoom note interface function has not been able to work

我按照你的截图增加了flag:add clickable但是点击还是没有反应,其他按键我是设置触发事件是点击标签背景图片变色这个是可以实现的,但这个放大缩小便签接口函数一直不行。

lv_obj_set_style_transform_pivot_x(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);

lv_obj_set_style_transform_pivot_y(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);

lv_obj_set_style_transform_width(item_array_1a[i].item_obj_icon, 512, LV_PART_MAIN);

lv_obj_set_style_transform_height(item_array_1a[i].item_obj_icon, 128, LV_PART_MAIN);

タグ(2)
0 件の賞賛
返信
202件の閲覧回数
WenbinYuan
NXP Employee
NXP Employee

Hi @zhuangfei,

Could you please share a bit more about your project setup? For example, the logic behind this case — do you want to trigger a scaling effect on label_b when label_a is clicked? if yes, the  LV_OBJ_FLAG_CLICKABLE flag should be enabled to label_a

In my case, using your code, at least the label_b does change its main size. However, the effect isn’t perfect — the font size doesn’t scale accordingly.

BTW, could you please share the reason why you chose LVGL v8.3.10 for your project? We generally recommend using the latest version of LVGL, as it includes important improvements and bug fixes that might help with your use case.

您能麻烦给出这个用例的详细信息吗?例如具体的逻辑链条,您是想在点击label_a的时候让label_b缩放大小吗?这样的话label_a需要使能 LV_OBJ_FLAG_CLICKABLE 。

在我这边的重现中,至少label_b本身的大小是会改变的,只是文本的大小不会改变。

能顺便问一下您选择V8.3.10版本开发的原因吗?我们比较推荐使用最新的LVGL版本,因为有很多功能被丰富了,比如Transform有了更多的配置,可以顺利的改变整个label的大小包括字体本身。

Looking forward your update!

Best Regards,

Wenbin

 

0 件の賞賛
返信
96件の閲覧回数
zhuangfei
Contributor II
The V8.3.10 version of the interface has a problem, the V9.2.1 version of the interface can achieve the function:
lv_obj_set_style_transform_pivot_x(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_pivot_y(item_array_1a[i].item_obj_icon, 50, LV_PART_MAIN);
lv_obj_set_style_transform_scale_x(item_array_1a[i].item_obj_icon,384,LV_PART_MAIN);
lv_obj_set_style_transform_scale_y(item_array_1a[i].item_obj_icon,384,LV_PART_MAIN);

Thanks to wenbin
180件の閲覧回数
zhuangfei
Contributor II

Hi: @WenbinYuan 

Yeah, what I'm trying to do is I'm going to make label_b scale when I click on label_a. In addition, why use V8.3.10 version is because we use the development board of your company MIMXRT1170-EVK, LVGL V9.2.1 version does not have the corresponding device template, but V8.3.10 exists. Our company also hopes to use the latest version of LVGL version. Is it possible to use the device template without MIMXRT1170-EVK development board now?

是的,我目前想实现效果是点击label_a的时候让label_b缩放大小。另外,为什么使用V8.3.10版本是因为我们使用您公司MIMXRT1170-EVK的开发板,LVGL V9.2.1版本中没有对应设备模板,而V8.3.10中存在。我们公司也希望使用最新版的LVGL版本,现在是没有MIMXRT1170-EVK开发板的设备模板也可以使用吗?

zhuangfei_0-1758244955307.png

 

0 件の賞賛
返信