2009-10-23 8 views
0

J'ai mis du texte dans un UITextView. Maintenant, je veux que le texte intérieur occupe l'espace supplémentaire quand l'appareil devient horizon. Mais de cette façon, ne faites que remplir la toile dans tout l'espace, pas dans le texte.comment agrandir le texte dans UITextView lors de la rotation vers UIInterfaceOrientationLandscapeRight

// This method is called by NSNotificationCenter when the device is rotated. 
-(void) receivedRotate: (NSNotification*) notification 
{ 
UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation]; 

if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) 
{ 
    self.view.transform = CGAffineTransformMakeRotation(-M_PI/2); 
    self.view.bounds = CGRectMake(0, 0, 416, 320); 

Répondre

1

Utilisez-vous xibs et constructeur d'interface pour votre point de vue? Si c'est le cas, vous devriez pouvoir utiliser struts and springs pour que l'UITextView se redimensionne automatiquement. Sinon, vous devrez réinitialiser la taille de UITextView par programmation dans la méthode receivedRotate:.