一起學Windows Phone7開發(十三.六 Web控制項)

來源:互聯網
上載者:User

      是phone7中的瀏覽器控制項,它是基於Internet Explorer7的,可以直接嵌入到應用程式中。這個控制項相對於Windows mobile也有了許多的不同。另外這個控制項與MediaElement 一樣,只是一個基本顯示視窗,所有的控制都需要自已來完成。如Forward、Backward、Refresh等。

<phone:WebBrowser Grid.Row="1" HorizontalAlignment="Left" Name="webBrowser1" VerticalAlignment="Top" Height="649" Width="480"  Source="http://www.baidu.com" IsScriptEnabled="False"/>

Source:要載入的HTML頁。

IsScriptEnabled:是否運行頁面指令碼。預設為不可用。

 

 

該控制項可以完成以下功能:

動態載入HTML內容:

webBrowser1.NavigateToString("<html><head><meta name='viewport' content='width=480, user-scalable=yes' /></head><body>HTML Text</body></html>");

載入靜態HTML頁面或Isolate Storage上的HTML頁面:

                         webBrowser1.Navigate(new Uri("readme.htm", UriKind.Relative));

載入網路上的Web頁面:

webBrowser1.Source = new Uri("http://www.baidu.com", UriKind.Absolute);

另外,這個控制項還支援.xhtml的瀏覽。

如:webBrowser1.Navigate(new Uri("http://www.flashkit.com/index.xhtml", UriKind.Absolute));

 

 

但是該控制項也有一些無法完成的功能:

無法瀏覽https頁面;

         無法顯示加密表徵圖;

         不支援Plug-ins。

如:webBrowser1.Navigate(new Uri("https://ibsbjstar.ccb.com.cn/V5/index.html", UriKind.Absolute));

 

Phone7與silverlight還是有一定的區別的,以下是對比表:

Phone7上擴充的Javascript function:

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.