Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad {
- [super viewDidLoad];
- _view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
- _view.backgroundColor = [UIColor greenColor];
- [self.view addSubview:_view];
- _contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1000, 500)];
- _contentView.backgroundColor = [UIColor orangeColor];
- [_scrollView addSubview:_contentView];
- _scrollView.contentSize = _contentView.bounds.size;
- _scrollView.scrollEnabled = YES;
- _textView = [[TSTextView alloc] initWithFrame:CGRectMake(50, 50, 100, 50)];
- _textView.text = @"Hallo dit is een test redrawing.";
- _textView.backgroundColor = [UIColor clearColor];
- _textView.textColor = [UIColor redColor];
- _textView.font = [UIFont fontWithName:@"Helvetica" size:20];
- UITextView *label = [[UITextView alloc] initWithFrame:CGRectMake(50, 50, 100, 50)];
- label.text = @"Hallo dit is een test.";
- label.backgroundColor = [UIColor clearColor];
- label.textColor = [UIColor purpleColor];
- label.font = _textView.font;
- [_contentView addSubview:label];
- [_contentView addSubview:_textView];
- _textRenderView = [[TSTextRenderView alloc] initWithFrame:CGRectMake(50, 100, 100, 50)];
- _textRenderView.text = @"LOLWHUT";
- [_contentView addSubview:_textRenderView];
- }
- #pragma mark ScrollView Delegates
- - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
- _textView.contentScaleFactor = scale;
- [_textView setNeedsDisplay];
- _textRenderView.contentScaleFactor = scale;
- [_textRenderView setNeedsDisplay];
- }
- - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
- return _contentView;
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement