zl程序教程

您现在的位置是:首页 >  其它

当前栏目

lvgl v8之scrolling with Right To Left base direction

to with base left V8 right LVGL
2023-09-14 09:06:41 时间

scrolling with Right To Left base direction

/**
* Scrolling with Right To Left base direction
*/
static void lv_example_scroll_5(void)
{
    lv_obj_t* obj = lv_obj_create(lv_scr_act()); // 创建obj对象
    lv_obj_set_style_base_dir(obj, LV_BASE_DIR_RTL, 0);// 设置LV_BASE_DIR_RTL对齐方式
    lv_obj_set_size(obj, 200, 100); //设置obj大小
    lv_obj_center(obj);  // 居中显示
    lv_obj_t* label = lv_label_create(obj); // 在Obj对象上创建label对象
     lv_label_set_text(label, "This page is for people who already know some English,\
 and can read a page like this written in basic English."); // 设置label显示内容
    lv_obj_set_width(label, 400); //设置label宽度
  
}

运行效果图

在这里插入图片描述