例如,在iOS设置>Wi中,单元格的复选标记位于(连接网络的)左侧,右侧是“泄露”按钮。
我需要这个。在iOS 7中有标准的方法来获得这个吗?
发布于 2014-02-08 16:50:51
不使用自定义单元格,您可能更喜欢UITableViewCellStyleDefault样式的单元格。它有一个可选的imageView,使用复选标记作为图像。
或者,您可以使用unicode符号作为复选标记。这是一个非常简洁的解决方案,并对here进行了很好的解释。
发布于 2014-02-08 16:45:58
没有标准的方法将附件放在左边,似乎他们只是使用单元格的imageView作为标记,并在右边构建了详细的披露指示器。
发布于 2016-04-13 10:03:14
这不是确切的解决方案,而是类似于iOS在其WiFi清单中所做的事情,只使用unicode字符作为复选标记和属性化字符串来将颜色设置为复选标记。
NSString *strCellText = @"This row is selected";
NSString *strCheckMarkUnicode = @"\u2713";
NSString *strFinalText = [NSString stringWithFormat:@"%@ %@",strCheckMarkUnicode,strCellText];
NSMutableAttributedString *strAttributedText = [[NSMutableAttributedString alloc]initWithString:strFinalText];
NSRange range=[strFinalText rangeOfString:strCheckMarkUnicode];
[strAttributedText addAttribute:NSForegroundColorAttributeName
value:[UIColor blueColor]
range:range];
_cellOne.textLabel.attributedText = strAttributedText;

https://stackoverflow.com/questions/21648472
复制相似问题