I basically have a UITextView, and when I rotate it, the content size is wider than the frame size. This causes the text view to scroll horizontally when there is no text outside the frame. This behavior is not required.
UITextView *ingredientsTextView = [[[UITextView alloc] initWithFrame:CGRectMake(50, 100,315,300)] autorelease];
[ingredientsTextView setBackgroundColor:[UIColor clearColor]];
[ingredientsTextView setEditable:NO];
[ingredientsTextView setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
[ingredientsTextView setFont:[UIFont fontWithName:@"Helvetica" size:18]];
[ingredientsTextView setText:ingredientsText];
ingredientsTextView.transform = CGAffineTransformMakeRotation((3.44*M_PI)/180);
[ingredientsView addSubview:ingredientsTextView];
I do not understand why this is happening. Even turning on the method setContentSizemakes it scroll horizontally (only about 5/10 points), even when the width is <100
Any ideas? Is this just a side effect of rotation?
Thanks tom
source
share