iphone - Calculate the contentsize of scrollview -
I see table view as a detailed view of cell, there are several views on detailed views like labels, buttons, etc. I am making it through the builder. What I am building through the interface builder is stable I am putting everything at the height of 480.
On my expanded view, a label is dynamic text that can extend to any length. The problem is that I need to set the content size of ScrollView for which I want its height
Try to use ScrollAllows Contact Size. It worked for me and I had the same problem with control using dynamic content.
// Calculate Scroll View Size Float Size Offcontent = 0; Int i; (I = 0; i & lt; [myScrollView.subviews count]; i ++) {UIView * view = [myScrollView.subviews ObjectAntIndex: i]; SizeOfContent + = view.frame.size.height; } // Set the size of the content for the scroll view myScrollView.contentSize = CGSizeMake (myScrollView.frame.size.width, sizeOfContent);
To do this, I do this in the controller in a method called viewWillAppear which holds scrollableview.
Hope this will solve your problem.
// hannes
Comments
Post a Comment