Текст не отображается на UILabel, если текст слишком велик.

У меня есть текст (история книги). Я беру UILabel, чтобы отобразить его. Но это не показывает мне на вид. Я использую следующий код:

    CGSize labelsize;
    UILabel *commentsTextLabel = [[UILabel alloc] init];;
    [commentsTextLabel setNumberOfLines:0];
    commentsTextLabel.textColor = [UIColor blackColor];
    [commentsTextLabel setBackgroundColor:[UIColor clearColor]];
    [commentsTextLabel setFont:[UIFont fontWithName:@"ACaslonPro-Regular"size:17]];
    labelsize=[story sizeWithFont:commentsTextLabel.font constrainedToSize:CGSizeMake(280, 15000) lineBreakMode:NSLineBreakByWordWrapping];
    commentsTextLabel.frame=CGRectMake(20, 200, 280, labelsize.height);
   commentsTextLabel.text = story;// more than 1000 lines

   [self.view addSubview:commentsTextLabel];

Когда я отлаживал свой код, я обнаружил labelize.height в моем случае 13145. Тем не менее он не отображается. Если я уменьшу 15000 до 11000, то текст будет отображаться с ... наконец.

labelize = [story sizeWithFont: commentsTextLabel.font constrainedToSize: CGSizeMake (280, 15000) lineBreakMode: NSLineBreakByWordWrapping];

Пожалуйста, помогите мне. Спасибо

Ответы на вопрос(6)

Ваш ответ на вопрос