views:

297

answers:

1

I put some text into a UITextView. Now I wanna make the inside text occupy the additional space when device become horizon. But this way only make canvas fill in all the space not the text.

// 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);
+1  A: 

Are you using xibs and interface builder for your views? If so, you should be able to use struts and springs to have the UITextView resize automatically.

If not, you'll have to reset the UITextView's size programmatically in the receivedRotate: method.

Justin Gallagher