How to get a checkmark on the left side of UITableViewCell on iOS 7, for example, in the settings?

In iOS> Wi-Fi settings, for example, the cell flag is on the left (of the connected network), with the disclosure button on the right.

I need this. Is there a standard way in iOS 7 to get this?

+6
source share
4 answers

Without using a custom cell, you might prefer a stylish cell UITableViewCellStyleDefault. It has an optional imageView, use a checkmark as an image.

Or you can use Unicode characters for checkmarks. This is a pretty neat solution and is greatly explained here .

+4
source

, , cellViewView .

+2

, - , 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;

enter image description here

+1

Swift 4 viewDidLoad()

tableView.allowsMultipleSelectionDuringEditing = true

!

0

Source: https://habr.com/ru/post/1525950/


All Articles