我正在开发一个表盘,并希望包含一些用户可以通过点击表盘打开的首选项(带有复选框等 UI 组件)。为此,打开首选项列表的正确方法是什么?是否可以在表盘项目中包含首选项(genlist、滑块等)的代码?或者我是否需要创建一个专用的 UI 项目,然后通过 Tizen Studio 的 Multi Package 功能将其与表盘绑定,并通过应用管理器 (app_control_h) 从表盘启动?
问问题
84 次
1 回答
0
@go3d,我认为您可以将 entry 组件用于用户文本输入。这是可穿戴设备上的入口用法文档。(https://docs.tizen.org/application/native/guides/ui/efl/wearable/component-entry/)我想您可以将入口组件的一些代码添加到 WeatherWatch 示例。
例子)
void maxlength_reached(void *data, Evas_Object *obj, void *event_info)
{
//Implements the behavior when the entry maxlenth is reached.
}
static void _entry_enter_click(void *data, Evas_Object *obj, void *event_info)
{
//Implements the behavior when the enter key is pressed.
}
// Create Entry Object.
Evas_Object* entry = elm_entry_add(layout);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
evas_object_smart_callback_add(entry, "maxlength,reached", maxlength_reached, NULL);
limit_filter_data.max_char_count = 0;
limit_filter_data.max_byte_count = 100;
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
elm_object_part_text_set(entry, "elm.guide", "input your text");
elm_entry_cursor_end_set(entry);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(entry, "activated", _entry_enter_click, NULL);
elm_object_content_set(layout, entry);
于 2021-04-22T08:43:01.887 回答