开发计算器
- 本篇主要照着官网实现了一下及计算器的案例,记录一下开发过程中的坑与android 的一些差别。
findComponentById
- harmony 实例化控件方法findComponentById ,其返回值类型为Component。
inputText = (TextField)findComponentById(ResourceTable.Id_input_text);
requestFocus
requestFocus 将光标放入所需的控件中。- 方法介绍:A component will not be able to actually take focus in any of the following situations: the component is not focusable (isFocusable() returns false); or the component is not focusable in touch mode (isTouchFocusable() returns false); or the component is invisible, disabled, or has not acquired space for drawing.
- 例如,Textfiled 控件可以,Text不行。
|