Attributierte Text Center Ausrichtung
Ich habe alles versucht, aber kann nicht scheinen, um Mitte dieses Textes. Kann mir bitte jemand sagen wo der Fehler ist.
NSMutableParagraphStyle *paragraphStyle = NSMutableParagraphStyle.new;
paragraphStyle.alignment = NSTextAlignmentCenter;
label.attributedText = [[NSAttributedString alloc] initWithString:cell.EventTitle.text attributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],NSParagraphStyleAttributeName:paragraphStyle,NSBaselineOffsetAttributeName : @0,NSFontAttributeName : [UIFont fontWithName:@"BrandonGrotesque-Black" size:34]}];
InformationsquelleAutor der Frage user3255746 | 2015-03-14
Du musst angemeldet sein, um einen Kommentar abzugeben.
Im Swift-3
InformationsquelleAutor der Antwort Shrawan
Können Sie die center-Ausrichtung mit dieser. Denken Sie daran, Bereich.
InformationsquelleAutor der Antwort user3575114
Im Swift 4
InformationsquelleAutor der Antwort Er. Vihar
Swift
InformationsquelleAutor der Antwort aguilarpgc
Einen anderen Weg:
Swift:
Obj-C:
InformationsquelleAutor der Antwort Hemang
Swift 4+
Objective-C
InformationsquelleAutor der Antwort Krunal
Swift4
InformationsquelleAutor der Antwort Daniel Leonard
Tun es in Swift 2.x
InformationsquelleAutor der Antwort Martin Romañuk