When you load the html files in your web view make sure that you set the base URL correctly using either loadHTMLString:baseURL:
or loadData:MIMEType:textEncodingName:baseURL:
. Then webview should load the images normally.
If you want to maximize them when the user taps, the easiest way would be something like this:
- inject jQuery into your EPUB html in
webViewDidFinishLoad:
- add an action to all
<img>
tags using jQuery which calls a cocoa method using a custom url protocol like my-epub-app://maximize-img/cool-photo.jpg
- catch and handle this custom protocol in your
webView:shouldStartLoadWithRequest:navigationType:
and return NO
to prevent webview from trying to load your invalid URL.
Hope this helps…