我在Visual Studio Code中找到了许多自动换行的示例和方法,但对于VS for Mac却没有.目前,我正在使用具有最新更新的企业版.
我有一个PCL,WP和WinStore项目.在PCL项目中,我有一个使用此方法的类:
private async Task<string> GetIpAddress()
{
const string url = "http://www.ip-adress.com/";
const string buscar = "<h3>Your IP address is:";
var client = new HttpClient();
var data = await client.GetStringAsync(url);
if (data.IndexOf(buscar, StringComparison.Ordinal) <= -1) return;
var IpAddress = data.Remove(0, data.IndexOf(buscar, StringComparison.Ordinal) + buscar.Length + 1);
IpAddress = IpAddress.Remove(IpAddress.IndexOf("</h3>", StringComparison.Ordinal));
return IpAddress;
}
Run Code Online (Sandbox Code Playgroud)
当我在Windows Phone项目上调用该方法时,可以完美地工作,但不能在Windows应用商店项目中运行.相反,我收到此错误消息:

c# web-services windows-phone portable-class-library windows-8
我正在使用Xamarin.Forms加载互联网的网页(客户端的要求,请不要评判我),问题是在iOS中网页看起来更大.
我在iOS上没有任何自定义渲染.
这是iPhone 6 iOS 11.1.2上的safari上加载的网站

这里加载在webview上

MainPage.xaml中
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Juppie"
x:Class="Juppie.MainPage">
<Grid>
<WebView x:Name="Navegador" Source="http://empleosapp.caonainteractive.com/"
WidthRequest="1000" HeightRequest="1000" IsVisible="{Binding Path=HayInternet}" ></WebView>
<ActivityIndicator IsRunning="{Binding Path=Navegando}" IsVisible="{Binding Path=Navegando}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.33}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.33}"/>
</Grid>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
MainPage.xaml.cs中
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Plugin.Connectivity;
using System.ComponentModel;
namespace Juppie
{
public partial class MainPage : ContentPage, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public MainPage()
{
InitializeComponent();
Navegador.Navigating …Run Code Online (Sandbox Code Playgroud)