0

我一直在做一个 Tizen 项目,我需要计算一个人的 BMI。所以我需要输入用户的姓名以及用户的身高和体重。到目前为止,我已经创建了一个功能界面,我可以在其中将用户导航到选项。我可以提示输入并弹出键盘。但我不确定如何像我们在 android 上那样将输入保存在变量中:int/String x = editText.getText()

我进行了很多搜索,但 tizen 社区在文档方面似乎更先进一些。任何帮助将不胜感激。下面是一些编辑文本的代码(用于文本输入)。我只需要知道如何从中提取输入值。

编辑文本代码:

static Evas_Object *
create_singlelines_editfield_layout(Evas_Object *parent) {
Evas_Object *editfield, *entry, *button, *buttonOk;

editfield = elm_layout_add(parent);
elm_layout_theme_set(editfield, "layout", "editfield", "singleline");
evas_object_size_hint_align_set(editfield, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(editfield, EVAS_HINT_EXPAND, 0.5);

entry = elm_entry_add(editfield);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_object_part_text_set(entry, "elm.guide", "Enter Your Weight");
evas_object_smart_callback_add(entry, "focused", editfield_focused_cb, editfield);
evas_object_smart_callback_add(entry, "unfocused", editfield_unfocused_cb, editfield);
evas_object_smart_callback_add(entry, "changed", editfield_changed_cb, editfield);
evas_object_smart_callback_add(entry, "preedit,changed", editfield_changed_cb, editfield);
elm_object_part_content_set(editfield, "elm.swallow.content", entry);
//elm_object_part_content_set(editfield, "elm.swallow.button", button);
return editfield;
}

谢谢

4

1 回答 1

2
char const * const text = elm_entry_entry_get(ad->input);

您可以通过以下方式看到它的实际效果:

https://github.com/rzr/ekzekuto

于 2016-06-16T20:48:05.390 回答