Tag: xamarin.forms

错误:ConnectFailure(连接被拒绝)

我有xamarin.forms应用程序,我试图从PC连接本地主机到Iphone模拟器在Mac中,我使用IP地址连接, private string Uri = "http://192.168.0.16:62271/";//Windows Ip address:localhost port number private string GetDishesUrl = "api/DishDetails/GetDishDetails?id=5"; try{ var httpClient = new HttpClient(); httpClient.BaseAddress = new Uri(Uri); var response = await httpClient.GetAsync(new Uri(Uri + GetDishesUrl)); var stringAsync = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { var responseJson = stringAsync; return JsonConvert.DeserializeObject<List<DishDetails>>(responseJson); } } catch(Exception ex) { } 在这里我得到以下exception: {System.Net.Http.HttpRequestException: […]

发行Apple Store:非公开API“setMaximumLength,MaximumLength

我在“Apple Store”上发布应用程序时遇到问题; 苹果拒绝发布该应用程序,因为它find了非公开API的引用,具体来说就是:“setMaximumLength:,MaximumLength”。 不幸的是,分析源代码,我没能find这些Apis的调用。 我怎么解决这个问题? —苹果消息— 5性能:软件要求性能 – 2.5.1 您的应用使用或引用以下非公开API: setMaximumLength:,maximumLength 应用程序商店不允许使用非公共API,因为如果这些API发生更改,可能会导致糟糕的用户体验。 —留言结束— Versione XCode 8.0 版本Xamarin.Forms2.3.2.127 Xamarin for Visual Studio 4.2 Xamarin.iOS 10

Xamarin.Forms iOS UIKit.UIImage错误

我一直在使用Xamarin.Forms制作移动应用程序。 我有一切工作在Android上,但是当我尝试在iOS上启动时,我得到的错误: System.Exception: Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil. >It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false. …. 有谁知道如何解决这个问题? 编辑:这是它给我的错误的代码,但我有感觉别的是导致它: using System; using System.Collections.Generic; using System.Linq; using Foundation; using UIKit; namespace CloudClubv1._2_.iOS { public class Application { // This is the main […]

如何在iOS ViewCellRenderer中更改窗体ViewList的MenuItem颜色?

有没有办法改变Xamarin.Forms Xaml文件中添加的ContextAction菜单的颜色。 IsDestructive="True"将菜单颜色设置为红色。 但我需要另一个菜单看起来像绿色或其他颜色。 这是我的Forms Xaml代码 <ListView x:Name="planList" ItemsSource="{x:Static local:SampleData.PLAN_DATA}" RowHeight="150" HorizontalOptions="FillAndExpand"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.ContextActions> <MenuItem Clicked="OnEditClick" Text="Edit" CommandParameter="{Binding .}"/> <!– THIS HAS TO BE GREEN COLOR –> <MenuItem Clicked="OnDeleteClick" Text="Delete" IsDestructive="True" /> </ViewCell.ContextActions> <ViewCell.View> <StackLayout Orientation="Vertical" HorizontalOptions="Start" VerticalOptions="FillAndExpand"> <!–Non Editable State–> <StackLayout Orientation="Horizontal" Spacing="28" IsVisible="{Binding isNotSaveState}"> <Frame WidthRequest="130" HeightRequest="50" BackgroundColor="#151617" HorizontalOptions="Start"> <Label Text="{Binding […]

Xamarin – iOS在地图上的多个多边形

我目前正在按照这个教程向地图添加一个多边形。 我需要能够添加多个多边形到我的地图,所以我稍微改变了代码,以便我可以使用addOverlays ,它接受一组IMKOverlay对象,而不是一个addOverlay , addOverlay需要一个IMKOverlay对象。 这不起作用,但它只绘制地图上的第一个多边形! void addPolygonsToMap() { overlayList = new List<IMKOverlay>(); for (int i = 0; i < polygons.Count; i++) { CLLocationCoordinate2D[] coords = new CLLocationCoordinate2D[polygons[i].Count]; int index=0; foreach (var position in polygons[i]) { coords[index] = new CLLocationCoordinate2D(position.Latitude, position.Longitude); index++; } var blockOverlay = MKPolygon.FromCoordinates(coords); overlayList.Add(blockOverlay); } IMKOverlay[] imko = overlayList.ToArray(); nativeMap.AddOverlays(imko); } […]

Xamarin窗体 – 如何使iOS ListView本机分组样式与头?

我已经在Xamarian窗体中创build了一个使用MVVM和绑定的列表视图来创build一个分组列表。我希望列表视图具有适用于iOS的UITableView样式组。 我试图通过我在网上find的自定义渲染器来创build这个,但是结果看起来不对,因为一切都是灰色的。 首先,我们将从图像开始。 这就是我想要的表格看起来像我从原生的iOS版本拿来的: 当我添加自定义渲染器时,我得到以下Xamarin表单版本: 我玩弄背景颜色,试图使它们透明,我发现,当我做了listview背景颜色=“透明”,原来的列表视图下。 显示在以下两张图片中。 xaml页面如下所示: <StackLayout Spacing="0"> <SearchBar x:Name="SearchBarControl" Text="{Binding SearchText}" SearchCommand="{Binding SearchCommand}" Placeholder="Search"></SearchBar> <ListView x:Name="HistoryList" IsGroupingEnabled="True" GroupDisplayBinding="{Binding Title}" ItemsSource="{Binding History}" CachingStrategy="RecycleElement"> <ListView.ItemTemplate> <DataTemplate> <TextCell Text="{Binding TagContent}" Detail="{Binding DateAndTime}" /> </DataTemplate> </ListView.ItemTemplate> </ListView> </StackLayout> 我相信自定义渲染器应该将其分组: [assembly: ExportRenderer(typeof(ListView), typeof(iOSListViewCustomRenderer))] namespace Test.iOS.CustomRenderer { public class iOSListViewCustomRenderer : ListViewRenderer { protected override void OnElementChanged(ElementChangedEventArgs<ListView> e) […]

没有findXamarin方法'CGSize..ctor'

我只是更新了xamarin工作室,然后在我的iOS项目中的xamarin.forms包。 这一切都build立好,但是当我尝试在模拟器中运行的应用程序,我得到以下错误: 找不到方法“CGSize..ctor”。 我创build了一个新的解决scheme build立并运行两个工作正常。 但后来我更新了新解决scheme中的xamarin.forms包。 同样的错误再次出现。 所以看起来好像新的软件包已经推出是错误的。 我们什么时候可以期待一个修补程序和一个新的xamarin.forms包的推出?

在scrollview中切换StackVery的IsVisible在Xamarin表单iOS中不能正确更新

我在scrollview中有很多的stacklayout视图,并且stacklayouts visibility属性根据select的选项设置为“true”或“false”。 使stacklayout isvisible属性为“true”在Xamarin Forms 1.4.0中不起作用,而不是显示stacklayout视图,它只是显示视图之间的空白空间。但它在Xamarin Forms 1.3.3中工作正常。 只发生在iOS,在Android它正在按预期工作。 任何帮助将非常感激。

支持纯IPv6networking的Xamarin表单,iOS

我刚刚提交我的应用程序到Appstore并得到这个错误: 在WWDC 2015上,我们宣布在iOS 9中过渡到纯IPv6networking服务。从2016年6月1日起,提交给App Store的所有应用程序必须支持纯IPv6networking。 大多数应用程序不需要任何更改,因为NSURLSession和CFNetwork API已经支持IPv6。 如果您的应用程序使用特定于IPv4的API或硬编码的IP地址,则需要进行一些更改。 通过阅读支持IPv6 DNS64 / NAT64networking并观看您的应用和下一代networking,了解如何确保兼容性 我也在Xamarin中search了IPv6,发现了相同的错误: https : //forums.xamarin.com/discussion/66732/does-xamarin-support-ios-ipv6-only-networks 任何人都有使用Xamarin支持IPv6的经验,请指教。 谢谢

在Xamarin.Forms的方向更改中添加布局

我需要实现的是,将屏幕从纵向更改为现有页面添加布局。 我已经设法检测使用void OnSizeAllocated(双倍宽度,双倍高度)的方向更改。 但是我不能在这个事件上添加一个布局。 我的示例C#代码是 public class MyLayoutView : ContentPage { StackLayout portraitcontent = null; StackLayout landscapecontent = null; StackLayout footer = null; public MyLayoutView () { portraitcontent = new StackLayout (); landscapecontent = new StackLayout (); footer = new StackLayout (); this.Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0); this.BackgroundColor = Color.FromHex ("#ffffff"); […]