您当前的位置: 首页 > 

仙剑情缘

暂无认证

  • 3浏览

    0关注

    333博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

text shadow for little vGL

仙剑情缘 发布时间:2020-02-19 19:43:46 ,浏览量:3

  • 文本阴影效果实现
    void text_shadows_demo(void)
    {
        static lv_style_t label_style;
        lv_style_copy(&label_style, &lv_style_plain);
        label_style.text.opa = LV_OPA_50;
        /*Create a label for the shadow first (it's in the background*/
        lv_obj_t* shadow_label = lv_label_create(lv_scr_act(), NULL);
        lv_label_set_style(shadow_label, LV_LABEL_STYLE_MAIN, &label_style);
        /*Create the main label*/
        lv_obj_t* main_label = lv_label_create(lv_scr_act(), NULL);
        lv_label_set_text(main_label, "A simple method to create\n"
            "shadows on text\n"
            "It even works with\n\n"
            "newlines and     spaces.");
    
        /*Set the same text for the shadow label*/
        lv_label_set_text(shadow_label, lv_label_get_text(main_label));
        /*Position the main label*/
        lv_obj_align(main_label, NULL, LV_ALIGN_CENTER, 0, 0);
    
        /*Shift the second label down and to the right by 1 pixel*/
        lv_obj_align(shadow_label, main_label, LV_ALIGN_IN_TOP_LEFT, 3, 3);
    }
  • 效果图

 

 

 

 

 

 

 

 

 

 

关注
打赏
1658017818
查看更多评论
立即登录/注册

微信扫码登录

0.0352s