UIWebView載入本地HTML檔案中有本地圖片的索引
// 013-11-18 16:58:23.959 Sports[480:907] imgPath:/var/mobile/Applications/D0233988-9785-465A-BF95-81DF334B367C/Sports.app/SPBGLogo.png
// 2013-11-18 16:58:25.989 Sports[480:907] htmlPath:/var/mobile/Applications/D0233988-9785-465A-BF95-81DF334B367C/Sports.app/Article.html
不想通過客戶端傳值的方式,因為是放在根目錄的,想用相對路徑的方式解決這個問題,
文章中寫的都是
You can then refer to your images like this:
<img src="myimage.png">
Or from within CSS like this:
background-image: url(loading.gif)
但是我這裡搞不定,暫時。未完待續。
這樣子是可以的
.placeholder
{
width: 300;
height: 300;
background-repeat: no-repeat;
background-size: contain;
background-image:url('file:/var/mobile/Applications/D0233988-9785-465A-BF95-81DF334B367C/Sports.app/SPBGLogo.png');
}
可以顯示我的logo。