def tableview_cell_for_row(self, tableview, section, row):
param = self.params[row]
name = param.displayName
cell = None
if name == None or name == '':
name = param.name
if param.type == 'bool':
cell = ui.TableViewCell()
cell.selectable = False
switch = ui.Switch()
switch.name = param.name
switch.value = param.value
switch.y = cell.center.y - switch.height/2
switch.x = cell.width + switch.width/2
switch.action = self.switch_change
cell.add_subview(switch)
else:
cell = ui.TableViewCell('value1')
if not param.value == None:
cell.detail_text_label.text = str(param.value)
cell.detail_text_label.text_color = self.thememanager.main_text_colour
cell.text_label.text = name
cell.background_color = self.thememanager.main_background_colour
cell.text_label.text_color = self.thememanager.main_text_colour
return cell
评论列表
文章目录