El método de llamada sizeToFit en un UILabel que tiene subíndices no funciona
Tengo una subclase de UILabel, que se supone que actualiza su texto cuando el usuario escribe algo. Naturalmente, a medida que aumenta la longitud del texto, el tamaño de la etiqueta debe ajustarse para acomodar el texto. Llamé al método sizeToFit, y aunque la etiqueta ajusta su ancho correctamente, la parte inferior del texto se corta. El problema es que el texto incluye subíndices y superíndices, y la etiqueta no se ajusta con los subíndices en consideración (por ejemplo, con H₂O, la parte inferior de los dos está cortada).
¿Puedo anular sizeToFit o sizeThatFits: para aumentar la altura de la etiqueta?
EDITAR
- (void) addCompound {
self.currentLabel = [[FormulaLabel alloc] initWithFrame:CGRectMake(10, 10, 100, 50)];
[self addSubview:self.currentLabel];
[self.currentLabel sizeToFit];
// Right now self.currentlabel.text = "". However, I've confirmed thru NSLogging that letters are added to self.currentLabel.text as the user types on the keyboard. Also, the text displays properly (as long as it's within the original frame) when I remove [sel.currentLabel sizeToFit]
}