2013年11月6日 星期三

Android using html on string.xml



  • string.xml

<string name="myHtmlString">
    <Data><![CDATA[ 
    <font size="2">
    2013/11/08<br>
    <ul>
    <li><font color="0000FF">Ver. 0.99</font></li>
    </ul>
    </font>
     ]]> </Data>
</string>


  • 程式,使用WebView來秀Html

WebView wv_myHtmlString=(WebView)d.findViewById(R.id.myHtmlString);
wv_myHtmlString.loadDataWithBaseURL(null,
   getResources().getString(R.string.myHtmlString),
   "text/html", "utf-8",
   null);


  • 結果如下


2013/11/8
  • Ver.0.99



沒有留言:

張貼留言