I have UIScroll that have uitextview inside it.
My apps look like this:
rootviewcontroller
-> PhoneContentController
(UIScrollView
and PageControl
) -> DetailController
(UITextView
, UIWebView
, UILabel
).
My Flow is like this:
Set UIScrollView
default size -> call DetailController
(calculate UITextView
and other page inside it in viewDidLoad
) -> PhoneContentController
get the total height size from DetailController
-> Change the height of UIScrollView
This is the code in PhoneContentController
(loadSCrollViewWithPage
):
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, [detailController.getTotalHeight]);
The code in Detail Controller (viewDidLoad
):
summaryBlogParsed = [summaryBlogParsed stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
[self.itemSummaryText setText:summaryBlogParsed];
CGRect frameTextView = self.itemSummaryText.frame;
frameTextView.size.height = self.itemSummaryText.contentSize.height;
self.itemSummaryText.frame = frameTextView;
This code in DetailController
getTotalHeight
:
CGRect cgRect = [[UIScreen mainScreen] bounds];
CGFloat scrollFrame = (cgRect.size.height/2) + itemSummaryText.frame.size.height;
return scrollFrame;
I can scroll the scrollview but the textview
not load all of the string. like only half of it, but i can scroll down but with blank pages :(.
Anyone can help me?
Thank you