У меня есть UITextView
, добавленный в мой UIView
. Текстовое добавление не редактируется, это просто отображение некоторых данных. Данные, отображаемые в текстовом режиме, являются динамическими. То есть количество строк не фиксировано. Он может меняться. Поэтому, если число строк увеличивается, размер текста также необходимо увеличить. Я не знаю, как это сделать. Пожалуйста, дайте мне несколько идей.
UPDATE:
Вот что я делаю:
UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 200)];
baseView.backgroundColor = [UIColor grayColor];
[window addSubview:baseView];
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(5, 30, 100, 30)];
textView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
textView.text = @"asdf askjalskjalksjlakjslkasj";
[textView sizeToFit];
[baseView addSubview:textView];