I have a UILabel that I use to display multiple lines of text. The moment the text is displayed, it is directly opposite the left side of the label, which does not look too large. I would like the text to be slightly pasted to the left.
This is my code:
if notes.objectAtIndex(indexPath.row) as NSString == "" { cell.notesLabel.text = "No notes to display." cell.notesLabel.textAlignment = NSTextAlignment.Center } else { cell.notesLabel.textAlignment = NSTextAlignment.Left }
I watched a few examples of Objective-C, but I couldn't get them to work, and I really don't think they were what I was looking for.
In addition, I tried to do the same with a different label, in which case I suggested that I could just add "" to the end of the line (since this is one line label) to move it from the right, but I was surprised seeing that this does not work?
Thanks.
source share