本帖最后由 yideng 于 2021-9-20 16:09 编辑
- -- ================== 多选框 =======================
- local checkBoxClass = class("CheckBox", viewClass)
- function checkBoxClass:ctor(text, id)
- self._id = id or self.__cname .. getViewID()
- self._text = text or "单选框"
- self._check = false
- self._w = -2
- self._h = -2
- self._pd = {1,1,1,1}
- self._textSize = 12
- end
- --- 设置是否勾选
- --- @param check boolean 默认false
- function checkBoxClass:check(check)
- self._check = check
- if self.isCreated then
- ui.setCheckBox(self._id, self._text, self._check, self._w, self._h)
- end
- return self
- end
- function CheckBox(text, id)
- return checkBoxClass.new(text, id)
- end
复制代码 设置了1,1,1,1 不好使呢。
- -- 设置内边距
- function viewClass:pd(l, t, r, b)
- self._pd = { l, t, r, b }
- if self.isCreated then
- ui.setPadding(self._id, l, t, r, b)
- end
- return self
- end
复制代码
|