开发者

how to make text wider in UITextView when rotate to UIInterfaceOrientationLandscapeRight

I put some text into a UITextView. No开发者_如何学JAVAw 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);


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜