2017-05-16 24 views
0

所以我試圖加載這個網址http://challonge.com/lhswaterwarslosersbracket1/module在網絡視圖中,但我想擺脫bottom_bar,因爲它顯示一個添加在我的應用程序,並只是一般學習,如果我可以編輯我的應用程序的網頁。我使用Xamarin表單和HTML敏捷性包。如何從Xamarin中的URL格式化HTML以在Web視圖中顯示?

public void ViewBracket() 
    { 


     WebView webView = new WebView 
     { 
      Source = new UrlWebViewSource 
      { 
       Url = "http://challonge.com/lhswaterwarslosersbracket1/module", 
      }, 
      VerticalOptions = LayoutOptions.FillAndExpand 
     }; 

     // Accomodate iPhone status bar. 
     this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5); 


     // Build the page. 
     this.Content = new StackLayout 
     { 
      Children = 
      { 
       //header, 
       webView 
      } 
     }; 

    } 
public async void DownloadHomepage() 
    { 
     var httpClient = new HttpClient(); 
     // var html = await httpClient.GetStringAsync("http://google.com"); 
     var html = await httpClient.GetStringAsync("http://challonge.com/lhswaterwarslosersbracket1/module").ConfigureAwait(false); 

     var doc = new HtmlDocument(); 
     doc.LoadHtml(html); 
     var bottombar = doc.GetElementbyId("bottom_bar"); 



     Debug.WriteLine(html); 

    } 
+0

所以你偷從網站內容並刪除他們用來支付賬單的廣告嗎? – Jason

+0

我只是想學習如何在Xamarin中編輯HTML,但幾乎可以回答你的問題,而且它不像我會是唯一一個,因爲在Play商店中有一個非官方的Challengo應用程序沒有廣告的支架我只是試圖複製它。 – BigDuke6

回答

相關問題