0

我将一些文本放入 UITextView。现在我想让内部文本在设备变为水平时占据额外的空间。但是这种方式只会使画布填充所有空间而不是文本。

// 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);
4

1 回答 1

1

您是否在为您的视图使用 xibs 和界面构建器?如果是这样,您应该能够使用struts 和 springs让 UITextView 自动调整大小。

如果没有,您必须在receivedRotate:方法中以编程方式重置 UITextView 的大小。

于 2009-10-23T16:48:03.220 回答