voglio cambiare l'UITextView a livello di codice con la quantità di testo che ho messo, e ho un problema, se aggiungo un l'UITextView con costruttore di interfaccia e faccio questo:cambiamento UITextView altezza di programmazione con il testo
CGRect frame = textViewA1.frame;
frame.size.height = textViewA1.contentSize.height;
textViewA1.frame = frame;
tutti bene il lavoro, ma se creo l'UITextView a livello di codice, l'altezza non cambiano, faccio questo:
UITextView *textViewA1 = [[UITextView alloc] initWithFrame:CGRectMake(5, 5, 320, 50)];
[textViewA1 setFont:[UIFont fontWithName:@"Enriqueta" size:15]];
[textViewA1 setScrollEnabled:NO];
[textViewA1 setUserInteractionEnabled:NO];
[textViewA1 setBackgroundColor:[UIColor clearColor]];
[textViewA1 setText:@"A lot of text"];
CGRect frame = textViewA1.frame;
frame.size.height = textViewA1.contentSize.height;
textViewA1.frame = frame;
in questo modo la dimensione altezza del UITextView non cambiano, come posso fare?
Perfetto grazie :) – Supertecnoboff
u r grande tizio ... –