Text after "div class =" itemprop = "text">
I have visited a UITextView in my view controller, I have class overrides and the awakeFromNib method I did
if (([NSLocale characterDirectionForLanguage: [[NSLocale preferredLanguages] objectAtIndex: 0]] == NSLocaleLanguageDirectionRightToLeft) {// Arabic} else {// English}
[self setTextAlignment: NSTextAlignmentCenter]; Also tried[self setBaseWritingDirection: UITextWritingDirectionLeftToRight forRange: [self-textRangeFromPosition: [self-startOfDocument] Toposition: [self-endoffdocast]]];
Also tried
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; Paragraph style. Align = NSTextAlignmentLeft; NSMutableAttributedString * string = [[NSMutableAttributedString alloc] initWithString: self.text]; [String addAttribute: NSParagraphStyleAttributeName Value: Paragraph Style Range: Nsmkrange (0, string lamps)]; Self.attributedText = string; The following has many so many questions, but no success in all by: (My TextView is always the right combination when the device language is Arabic. I left it aligned because I want to display English text. .
I was setting up the property in the awakeFromNib method and that was the problem. Set text alignment in Yntrk class and it worked fine for me. Please shed some light on this behavior.
Comments
Post a Comment