ElementRuntimeView.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:pythonista-scripts 作者: khilnani 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号