What is the best way to handle autorotation with multiple subview?
Posted
by thangnguyen
on Stack Overflow
See other posts from Stack Overflow
or by thangnguyen
Published on 2010-04-01T23:06:24Z
Indexed on
2010/04/01
23:13 UTC
Read the original article
Hit count: 375
I am learning and programing an application. I do this project based on what I learned from the book Beginning iphone 3 development. I have two main questions here:
I would like to create a multi utility application so I need multiple-view.
I have a main view controller which will control switching between views. In this example I have two views A and B. I have 2 view controller A and B which will handles all of events on these 2 views. I have 2 nib files viewA.xib and viewB.xib.
One of the uitility is reading PDF. So I create another class which handle the PDF file which can load a PDF page call PDFview. From Interface Builder, I selected class identity for view of the viewB.xib as PDFView class.
The result is I can switching between View A and view B. View B will display the content of the PDF page. I am not sure if my solution is right or wrong but now I don't know how to handle the autorotation.
The rotation will active the view controller B. But the PDFView handle how to display the PDF on the View.
Could you please tell me how I should handle this in a right way?
Second question:
Should I create the subview automatically? In case I need to do the swipe page animation, how can I do that? I think that I need to load another subview so I can do the animation when swap view. But I think this solution will waste the resource. I can just load another page of the PDF, but in this case I don't know how to use animation? Please tell me how I should solve this?
I highly appreciate your time reading and answering my question.
Thang Nguyen
© Stack Overflow or respective owner