-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About Text area (lv_ta) style #26
Comments
Hi, static lv_style_t style;
lv_style_get(LV_STYLE_PRETTY, &style);
style.ccolor = COLOR_RED; //Red text
style.mcolor = COLOR_GREEN; //Green color on the top of Text area
lv_obj_t * ta_1 = lv_ta_create(lv_scr_act(), NULL);
lv_obj_set_style(ta_1, &style); |
Hi, static lv_style_t style;
lv_style_get(LV_STYLE_PRETTY, &style);
style.ccolor = COLOR_RED; //Red text & red cursor?
style.mcolor = COLOR_GREEN; //Green color on the top of Text area
style.line_width = 5 * LV_DOWNSCALE;
lv_obj_t * ta_1 = lv_ta_create(lv_scr_act(), NULL);
lv_obj_set_style(ta_1, &style);
lv_obj_refr_style(ta_1); |
I have tried and found some ways to change the text color.
For example: static lv_style_t style;
lv_style_get(LV_STYLE_PRETTY, &style);
style.ccolor = COLOR_RED; // Red text
style.mcolor = COLOR_GREEN; // Green color on the top of Text area
style.line_width = 5 * LV_DOWNSCALE;
lv_obj_t * ta_1 = lv_ta_create(lv_scr_act(), NULL);
lv_obj_set_style(ta_1, &style);
/* create style for label */
static lv_style_t txt_style;
lv_style_get(LV_STYLE_PRETTY, &txt_style);
txt_style.ccolor = COLOR_YELLOW;
lv_obj_t * label = lv_ta_get_label(ta_1);
lv_obj_set_style(label, &txt_style); I'm not sure whether the two usages are correct or not. lv_obj_refr_style(ta_1); or lv_page_set_sb_mode(ta_1, LV_PAGE_SB_MODE_OFF); |
Sorry, I forget to say, already there is bugfix related to this. Please, check out lvgl and misc
What do you experience? |
I misunderstood that After testing on |
Great! :)
Thank you for reporting the issue. As it is working now I close it! |
sorry for my unclear. |
Sorry, I misread it. |
Fixed in v5.0.0 |
[ili9341] Add helper function to turn on and off the display backlight.
font_conv_for_lists: List parameter specific utility
fix: check malloc result before memcpy, not after
Make the example program buildable.
I have some question about
lv_ta
on website's documenttext style
Dose the "parent page" mean
lv_ta
's parent must be alv_page
object?But it seems that the text style can be accessed from label member in
lv_ta
.cursor style
I try to create a
lv_con
as the parent oflv_ta
, then change itsccolor
andline_width
, but it doesn't apply to cursor.Thank you!
The text was updated successfully, but these errors were encountered: