iphone - How to use an UIWebView to show small offline html documents? -
iphone - How to use an UIWebView to show small offline html documents? -
could ship app html document , display using uiwebview? how hard use?
is possible have little frame uiwebview inside, or take whole screen? , can rid of controls, uiwebview works advanced uilabel or uitextview?
yes; it's easy; can have little embedded webview; yes, naked web view has no controls.
in loadview
or viewdidload
method:
uiwebview *webview = [[uiwebview alloc] initwithframe:cgrectmake(...)]; [self.view addsubview:webview]; nsurl *url = [[nsbundle mainbundle] urlforresource:@"foo" withextension:@"html"]; nsurlrequest *request = [nsurlrequest requestwithurl:url]; [webview loadrequest:request]; [webview release];
this load foo.html file add together project resource. alternatively, can utilize loadhtmlstring:baseurl:
if want build html in code.
iphone uiwebview
Comments
Post a Comment