【发布时间】:2016-07-25 05:53:34
【问题描述】:
我对 xamarin 完全陌生。 我正在尝试在更改后让 Web 视图在 IOS 上刷新。 (以下代码在 IOS 模拟器上工作,但不在真实设备上工作,将显示兑现版本 - 以下代码中的 IP 地址是本地 Web 服务器,如果我在安装后更改网站中的任何内容,它不会反映更改)。
请帮忙。我做错了什么?
干杯
.xaml ->
<!--<controls:HybridWebView x:Name="hybridWebView">
</controls:HybridWebView>-->
<WebView x:Name="webView"
VerticalOptions="FillAndExpand"
Source="http://192.168.1.130" />
<StackLayout Orientation="Horizontal"
BindingContext="{x:Reference webView}">
<Button Text="⇐"
FontSize="Large"
HorizontalOptions="FillAndExpand"
Clicked="OnGoBackClicked" />
<Button Text="⇒"
FontSize="Large"
HorizontalOptions="FillAndExpand"
Clicked="OnGoForwardClicked" />
</StackLayout>
.xaml.cs ->
public WebPage()
{
InitializeComponent();
}
void OnEntryCompleted(object sender, EventArgs args)
{
//hybridWebView.Source = ((Entry)sender).Text;
}
void OnGoBackClicked(object sender, EventArgs args)
{
webView.Source="http://192.168.1.130";
}
void OnGoForwardClicked(object sender, EventArgs args)
{
webView.Source = "https://www.google.com";
}
【问题讨论】:
标签: xaml xamarin xamarin.forms