fxmxyy 发表于 2015-1-8 14:14:14

如何在本机Tizen应用添加编辑文本?

我试图了解GUI创建在本地Tizen应用。现在我可以添加标签和按钮。 但我找不到任何解决方案如何添加文本编辑(android TextEdit)。

下面的按钮我添加的代码:
   ad->button = elm_button_add(ad->box1);
   evas_object_smart_callback_add(ad->button, "clicked", btn_clicked_cb, ad);
   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0.1);
   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_object_text_set(ad->button, "Preform");
   evas_object_show(ad->button);
   elm_box_pack_end(ad->box1, ad->button);所以我尝试搜索elm_edit_text_add功能但没有结果。

良思俊旭 发表于 2015-5-19 15:05:20

这是一行的代码 条目 (TextEdit等效):    Evas_Object *entry;    Evas_Object *layout;
    Evas_Object *scroller;
    Evas_Object *box;
    Evas_Object *nf = data;

    scroller = elm_scroller_add(nf);

    box = elm_box_add(scroller);
    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
    elm_object_content_set(scroller, box);

    layout = elm_layout_add(box);
    elm_layout_file_set(layout, ELM_DEMO_EDJ, "entry_layout");
    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);

    entry = elm_entry_add(layout);
    elm_entry_single_line_set(entry, EINA_TRUE);
    elm_entry_scrollable_set(entry, EINA_TRUE);
    eext_entry_selection_back_event_allow_set(entry, EINA_TRUE);
    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_activated_cb, NULL);
    elm_object_part_content_set(layout, "entry_part", entry);

    elm_box_pack_end(box, layout);
    evas_object_show(layout);

更多类型的条目看看tizen SDK提供的例子。
页: [1]
查看完整版本: 如何在本机Tizen应用添加编辑文本?