uiview - How do you add a UINavigationBar to UIWebView such that the web content draw area scales to the area beneath the navigation bar? -
here's situation:
myviewcontroller has button called "help." pressing "help" activates following ibaction method, loads uiwebview displaying pdf. loads subview uiwebview uinavigationbar called "helpnavbar" "done" button. reason load helpnavbar programmatically because if don't that, helpnavbar gets covered on pdf display (although can still see if scroll pdf down far enough uncover it...!). however, the problem this: after loading helpnavbar programmatically, the pdf still scales full screen area (except beneath helpnavbar instead of on top of it).
here code ibaction method:
(ibaction)helpbuttonpress:(id)sender { uiview *current_view; current_view = self.view; [uiview beginanimations:@"switch" context:nil]; [uiview setanimationtransition:uiviewanimationtransitionflipfromleft forview:self.view cache:yes]; //[current_view removefromsuperview]; //still can't pdf show (it partially under button) self.helpview.autoresizingmask = uiviewautoresizingflexibleheight; self.helpview.autoresizessubviews = true; [self.helpview addsubview:helpnavbar]; [helpnavbar setautoresizingmask:uiviewautoresizingflexiblewidth]; [self.view addsubview:helpview]; [uiview commitanimations]; nsstring *thepath = [[nsbundle mainbundle] pathforresource:@"angle of view manual" oftype:@"pdf"]; if (thepath) { nsdata *pdfdata = [nsdata datawithcontentsoffile:thepath]; [self.helpview loaddata:pdfdata mimetype:@"application/pdf" textencodingname:@"utf-8" baseurl:nil]; } }
i should note: had same problem when uitableviewcontroller load. in case, created uiview 2 subviews: 1 tableview , 1 navbar. way tableview didn't cover on navbar. i know in case, feel that's kludgy way , there must easier/better way simple having interface , pdf view areas not draw on each other two-year-olds @ felt marker convention. if way "keep 'em separated" in separate subviews of master uiview, tell me "pay no mind" ... won't take "disrespect."
ps -- avoiding using separate uiviewcontroller basic. view needs pop , show brief pdf , have 'done' button, that's it. if there's easier way please, pipe :d
Comments
Post a Comment