I am looking for more tips on the right design to view.
I have a UIScrollView that contains one or more custom views that I created. My problem is who reports in scrollview what is contentSize? I have the following:
UIView
+-UIScrollView
+-CustomView 1 with dynamic height depending on data
+-CustomView 2 with dynamic Height depending on data
The UIViewController creates new instances of custom data views, and then adds them as subitems to the UIScrollView. The problem I am facing is how to set the value of scrollview contentSize? Right now, I am not doing this, and the contents of scrollview are cropped without being able to scroll.
- Should the user call view [parent setContentSize:] in his drawRect :?
- If a UIViewController requests a custom view after creation to get its borders, then calls setContentSize?
- Should I subclass UIScrollView to override addSubView to request each candlestick height?
- Is there anything else I am missing?
I hope I explained it correctly. I am new to this and still understand things.
Mike source
share