Skip to content

Instantly share code, notes, and snippets.

@michaelvillar
Created April 9, 2012 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelvillar/2344449 to your computer and use it in GitHub Desktop.
Save michaelvillar/2344449 to your computer and use it in GitHub Desktop.
TUITextView in TUIScrollView
scrollView_ = [[TUIScrollView alloc] initWithFrame:scrollViewFrame];
textView_ = [[TUITextView alloc] initWithFrame:scrollView_.bounds];
textView_.autoresizingMask = TUIViewAutoresizingFlexibleWidth;
scrollView_.horizontalScrollIndicatorVisibility = TUIScrollViewIndicatorVisibleNever;
scrollView_.scrollEnabled = YES;
scrollView_.clipsToBounds = YES;
[scrollView_ setContentSize:textView_.bounds.size];
[scrollView_ addSubview:textView_];
@mrjjwright
Copy link

Thanks!

@mrjjwright
Copy link

Isn't it necessary to synchronize the contentSize of the scrollview and the textview somehow?

@michaelvillar
Copy link
Author

Yes it is. I use the textViewDidChange delegate method to adjust the sizes.

@mrjjwright
Copy link

I tried modifying the example app for TUIKit and it's not working for me. I can't get the scrollview to scroll and update regularly. I hate to be a bother but mind commenting on what i am doing wrong or post an example. https://gist.github.com/2352504

@mrjjwright
Copy link

Hmm, moving the scrollbar is working but not the gestures, let me see what is up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment