类别 | 内容 |
方法签名 | uiCheckBox findByID(String arg0) |
返回值 | uiCheckBox- 多选控件对象(未找到时返回null ,需根据框架逻辑确认) |
参数 | String arg0- 控件的唯一标识符(ID) |
功能描述 | 通过控件 ID 在界面中查找并加载对应的多选控件实例 |
使用案例 | uiCheckBox checkBox = new uiCheckBox().findByID("user_hobby_checkbox"); |
类别 | 内容 |
方法签名 | String[] getAllChecked() |
返回值 | String[]- 包含所有选中项标识的字符串数组(无选中项时返回空数组) |
参数 | 无 |
功能描述 | 获取多选控件中所有被选中项的标识 |
使用案例 | String[] checkedItems = checkBox.getAllChecked();for (String item : checkedItems) {System.out.println ("选中项:" + item);} |
类别 | 内容 |
方法签名 | String[] getAllSelect() |
返回值 | String[]- 包含所有选项标识的字符串数组(控件无选项时返回空数组) |
参数 | 无 |
功能描述 | 获取多选控件中所有选项的标识(包括选中和未选中的所有选项) |
使用案例 | String[] allItems = checkBox.getAllSelect();for (String item : allItems) {System.out.println ("所有选项:" + item);} |
类别 | 内容 |
方法签名 | boolean getChecked(String arg0) |
返回值 | boolean- true 表示选中,false 表示未选中(选项不存在时通常返回false ) |
参数 | String arg0- 要判断的选项名 |
功能描述 | 判断多选控件中指定选项是否被选中 |
使用案例 | boolean isSelected = checkBox.getChecked ("游泳");System.out.println ("游泳是否选中:" + isSelected); |
类别 | 内容 |
方法签名 | void setChecked(String arg0, boolean arg1) |
返回值 | void- 无返回值 |
参数 | - String arg0:要设置的选项名- boolean arg1:是否选中(true 为选中,false 为未选中) |
功能描述 | 设置多选控件中指定选项的选中状态 |
使用案例 | checkBox.setChecked ("跑步", true); // 设置 “跑步” 为选中checkBox.setChecked ("跳绳", false); // 设置 “跳绳” 为未选中 |
类别 | 内容 |
方法签名 | void setCheckeds(String[] arg0, boolean arg1) |
返回值 | void- 无返回值 |
参数 | - String [] arg0:要设置的多个选项名数组- boolean arg1:是否选中(true 为选中,false 为未选中) |
功能描述 | 批量设置多选控件中多个选项的选中状态 |
使用案例 | String [] options = {"篮球", "足球"};checkBox.setCheckeds (options, true); // 批量设置为选中 |
类别 | 内容 |
方法签名 | void setHeight(int arg0) |
返回值 | void- 无返回值 |
参数 | int arg0:高度值(单位由 UI 框架定义,如像素) |
功能描述 | 设置多选控件的显示高度 |
使用案例 | checkBox.setHeight (200); // 设置控件高度为 200 像素 |
2.png (562.23 KB, 下载次数: 0)
| 欢迎光临 B2B网络软件 (http://bbs.niubt.cn/) | Powered by Discuz! X3.2 |