Part of my iOS app involves a PDF Reader. To display the page the user is on, I have created a UILabel and placed it in the PDFScrollView (subclass of UIScrollView). This label has to be in the scroll view because whenever I change the page, the scroll view sends a message to the IBOutlet of the label, telling it to change its text.
However, whenever I zoom in (scroll “out”) in the UIScrollView, the label zooms out as well (its size doesn’t change, but it travels outwards). This causes it to eventually move off the screen. How can I change it so the UILabel is static and unmoving in the UIScrollView?
Instead of subclassing the
UIScrollView, subclass aUIViewand place aUIScrollViewandUIViewas subviews with theUIViewnot being a subview of the scroll view. Place your label(s), etc. inside theUIViewand have the parent view manage communication between the scroll view and the other view.