Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
- how to set cells height in a table? It seems different from V6.0.2, I read the docs and try to add the padding style to the table, it seems not work.
- By the way, in V6.0.2, there is a declare
LV_TABLE_COL_MAX
inlv_conf.h
, in V8.0.1, is still has this declare and the limit of table column num?
What MCU/Processor/Board and compiler are you using?
What LVGL version are you using?
8.0.1
What do you want to achieve?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
static void ta_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * ta = lv_event_get_target(e);
if(code == LV_EVENT_CLICKED || code == LV_EVENT_FOCUSED) {
/*Focus on the clicked text area*/
if(g_keyboard != NULL)
{
lv_obj_clear_flag(g_keyboard, LV_OBJ_FLAG_HIDDEN);
lv_keyboard_set_textarea(g_keyboard, ta);
}
}
else if(code == LV_EVENT_READY) {
LV_LOG_USER("Ready, current text: %s", lv_textarea_get_text(ta));
}
}
static void KeyboardEventCB(lv_event_t* event)
{
// lv_keyboard_def_event_cb(event);
//
lv_event_code_t code = lv_event_get_code(event);
//
// lv_obj_t* ta_of_kb = lv_keyboard_get_textarea(g_keyboard);
//
if(code == LV_EVENT_CANCEL)
{
// lv_textarea_t * ta = (lv_textarea_t *)ta_of_kb;
// ta->cursor.show = 0;
lv_obj_add_flag(g_keyboard, LV_OBJ_FLAG_HIDDEN);
}
}
void CreateKeyboard(lv_obj_t* parent, lv_coord_t w, lv_coord_t h)
{
g_keyboard = lv_keyboard_create(parent);
lv_obj_set_size(g_keyboard, w, h);
lv_obj_align_to(g_keyboard, parent, LV_ALIGN_BOTTOM_RIGHT, 0, 0);
// lv_obj_add_event_cb(g_keyboard, KeyboardEventCB, LV_EVENT_CANCEL, NULL);
// lv_obj_add_flag(g_keyboard, LV_OBJ_FLAG_HIDDEN);
}
int main()
{
CreateKeyboard(lv_scr_act(), 940, 150);
lv_obj_clear_flag(g_keyboard, LV_OBJ_FLAG_HIDDEN);
lv_obj_t * text_ta = lv_textarea_create(lv_scr_act());
lv_textarea_set_one_line(text_ta, true);
lv_textarea_set_password_mode(text_ta, false);
lv_obj_set_width(text_ta, lv_pct(40));
lv_obj_add_event_cb(text_ta, ta_event_cb, LV_EVENT_ALL, NULL);
lv_obj_align_to(text_ta, NULL, LV_ALIGN_TOP_LEFT, 0, 60);
lv_obj_t * text_ta1 = lv_textarea_create(lv_scr_act());
lv_textarea_set_one_line(text_ta1, true);
lv_textarea_set_password_mode(text_ta1, false);
lv_obj_set_width(text_ta1, lv_pct(40));
lv_obj_add_event_cb(text_ta1, ta_event_cb, LV_EVENT_ALL, NULL);
lv_obj_align_to(text_ta1, NULL, LV_ALIGN_TOP_RIGHT, 0, 60);
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.