2015-01-28 4 views
0

WP8.1 앱의 Webview에서 html 파일을로드하려고합니다. 프로젝트 내부에 이미지가 저장되어 있습니다. 브라우저에서 html 파일을 실행하면 제대로 실행되지만 Webview에서이 html 파일을로드하면 이미지가 표시되지 않고 문자열에서 HTML 파일의 내용을 변환하고 NavigateToString 메서드를 시도 할 때 동일한 문제가 발생합니다. 여기 내 코드는WebView windows 전화 내 로컬 이미지 표시 8.1

<!DOCTYPE html> 
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <meta charset="utf-8" /> 
     <title></title> 
     <style> 
     table, th, td { 
      border: 0px; 
     } 
    </style> 
    </head> 
    <body> 
    <table> 
     <tr> 
      <img src="ms-appx:///discount_icon.jpg" alt="Smiley face" height="200" width="400" /> 
     </tr> 
     <tr> 
      <td> 
         <div align="Left" style="width: 100%;"> 
          <div style="width: 70%; float: left;"><b> Left </b> </div> 

          <div align="right" style="width: 30%; float: right;"> 
           <div align="right" style="position: relative; padding-top:10px; background-image: url('ms-appx:///discount_icon.jpg');background-size:cover; background-repeat:no-repeat; height:36px; width: 85px; font-weight: bold; color: black;"><span style="text-align:center;color:white; margin-right:27px;margin-top:15px">5%</span></div> 
          </div> 

          <div style="width: 70%; float: left;"> From <span style="background-color:#01A9DB;padding:2px;">$250.00</span> values </div> 

         </div> 
      </td> 
     </tr> 
     <tr> 
      <td>February</td> 
     </tr> 
    </table> 
    </body> 
    </html> 

누군가가 도와 줄 수 있습니까?

+0

문제인지 궁금해하는 것을 테스트 해 드릴까요? 귀하의''및' ' – Barnstokkr

+0

이 태그들은 올바르게 닫혀 있으며 이것은 문제되지 않습니다 –

답변

0

이미지 이름 앞에 ms-appx:///을 넣지 않아도됩니다.

당신은 HTML의 동일한 폴더에 이미지가있는 경우, 코드는 다음과 같습니다

<img src="test.png" style="width:100%; height:100%;" />

0

당신은 NavigateToLocalStreamUri을 시도 할 수 있습니다. 너는 그것을 할 수있다. 이 기능에 대한 많은 예제가 있습니다.

관련 문제