Вот пример, который может вас вдохновить.
Примечание. Я не знаю, как вы создаете весь свой текст, поэтому я не знаю, как вы узнаете, что на английском, а что на иврите, но вы уловите идею.
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:@"I bless You, God, for creating the fruit of the vine:\n בָּרוּךְ אַתָּה יְיָ אֱלֹהֵֽינוּ מֶֽלֶךְ הָעוֹלָם, בּוֹרֵא פְּרִי הַגָּֽפֶן."];
NSMutableParagraphStyle *englishParagraphStyle = [[NSMutableParagraphStyle alloc] init];
[englishParagraphStyle setAlignment:NSTextAlignmentLeft];
NSMutableParagraphStyle *hebrewParagraphStyle = [[NSMutableParagraphStyle alloc] init];
[hebrewParagraphStyle setAlignment:NSTextAlignmentRight];
NSRange englishRange = NSMakeRange(0, [@"I bless You, God, for creating the fruit of the vine:" length]);
NSRange hebrewRange = NSMakeRange([@"I bless You, God, for creating the fruit of the vine:" length],
[[attrStr string] length] - [@"I bless You, God, for creating the fruit of the vine:" length]);
[attrStr addAttribute:NSParagraphStyleAttributeName
value:englishParagraphStyle
range:englishRange];
[attrStr addAttribute:NSParagraphStyleAttributeName
value:hebrewParagraphStyle
range:hebrewRange];
[myLabel setAttributedText:attrStr];
Вы также можете сделать это перед установкой UILabel
:
[attrStr addAttribute:NSFontAttributeName
value:[UIFont whateverFontWithWhateverSize]
range:NSMakeRange(0, [attrStr length])];
person
Larme
schedule
27.06.2014
NSAttributedString
, установивNSParagraphStyle
, а затем[yourLabel setAttributedText:theAttributedString]
- person Larme   schedule 27.06.2014NSParagraphStyle
. - person Larme   schedule 27.06.2014