La alineación de texto TTStyledTextLabel no funciona cuando se usa la rotación de transformación
Frecuentes
Visto 162 equipos
0
Tengo un problema con TTSTyledTextLabel de Three20. he especificado la vista como esta
//iphone properties
htmlSubtitle_ = [[TTStyledTextLabel alloc] init];
htmlSubtitle_.font = [UIFont systemFontOfSize:14];
htmlSubtitle_.contentInset = UIEdgeInsetsMake(2, 2, 2, 2);
htmlSubtitle_.backgroundColor = [UIColor clearColor];
htmlSubtitle_.textColor = [UIColor whiteColor];
htmlSubtitle_.textAlignment = UITextAlignmentCenter;
htmlSubtitle_.userInteractionEnabled = NO;
htmlSubtitle_.text = [TTStyledText textFromXHTML:@"<p><p>I dont know where this\n is going<br/> but it is ok :D</p></p>" lineBreaks:YES URLs:YES];;
htmlSubtitle_.frame = CGRectMake(0, 390, 200, 90);
htmlSubtitle_.backgroundColor = [UIColor greenColor];
[self.view addSubview:htmlSubtitle_];
se parece a esto :
Y cuando giro la pantalla he escrito este código:
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight){
htmlSubtitle_.frame = CGRectMake(0, 0, 90, 200);
htmlSubtitle_.transform = CGAffineTransformMakeRotation(M_PI / 2);
htmlSubtitle_.backgroundColor = [UIColor greenColor];
}
y se ve así:
ver la alineación del texto, la alineación se ha cambiado a la izquierda en lugar de permanecer en el centro. ¿Alguien más tiene este problema? o estoy haciendo algo mal?
1 Respuestas
0
He usado UIWebView para mostrar el texto con estilo HTML en lugar de usar esta basura de TTStyledLabel... Gracias a todos.
Respondido 30 ago 12, 02:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas iphone objective-c ios three20 or haz tu propia pregunta.