UITableViewCellAccessoryCheckmark and AutoLayout constraints

后端 未结 3 2091
别那么骄傲
别那么骄傲 2020-12-06 00:42

I have custom UITableViewCell and manage selection of my cells. When the cell is selected and the checkmark is presented, the cell Content View wid

3条回答
  •  执笔经年
    2020-12-06 00:56

    How about putting the checkmark in there all the time, and just playing with the alpha / transparency?

        if checked
        {
            cell.accessoryType = .checkmark
            cell.tintColor = cell.tintColor.withAlphaComponent(1)
        }
        else
        {
            cell.accessoryType = .checkmark
            cell.tintColor = cell.tintColor.withAlphaComponent(0)
        }
    

提交回复
热议问题