Xamarin.iOS Unified API 注意要点
新数据类型
| NATIVE TYPE | 32-BIT BACKING TYPE | 64-BIT BACKING TYPE |
|---|---|---|
System.nint |
System.Int32 (int) |
System.Int64 (long) |
System.nuint |
System.UInt32 (uint) |
System.UInt64 (ulong) |
System.nfloat |
System.Single (float) |
System.Double (double) |
| OLD TYPE IN SYSTEM.DRAWING | NEW DATA TYPE | DESCRIPTION |
|---|---|---|
RectangleF |
CGRect |
Holds floating point rectangle information. |
SizeF |
CGSize |
Holds floating point size information (width, height) |
PointF |
CGPoint |
Holds a floating point, point information (X, Y) |
检查平台架构
if (IntPtr.Size == ) {
Console.WriteLine ("32-bit App");
} else if (IntPtr.Size == ) {
Console.WriteLine ("64-bit App");
}
Arrays and System.Collections.Generic
public List<string> Names = new List<string>();
... public string GetName(nint index) {
return Names[(int)index];
}
DateTime 与 NSDate需要显示转换
下面两个扩展方法帮助实现隐式转换:
public static DateTime NSDateToDateTime(this NSDate date)
{
// NSDate has a wider range than DateTime, so clip
// the converted date to DateTime.Min|MaxValue.
double secs = date.SecondsSinceReferenceDate;
if (secs < -)
return DateTime.MinValue;
if (secs > )
return DateTime.MaxValue;
return (DateTime) date;
} public static NSDate DateTimeToNSDate(this DateTime date)
{
if (date.Kind == DateTimeKind.Unspecified)
date = DateTime.SpecifyKind (date, /* DateTimeKind.Local or DateTimeKind.Utc, this depends on each app */)
return (NSDate) date;
}
NSAction Replaced with Action
Custom delegates replaced with Action<T>
Task<bool> replaced with Task<Tuple<Boolean,NSError>>
Xamarin.iOS Unified API 注意要点的更多相关文章
- [Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考、NuGet组件参考
[Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考.NuGet组件参考 解决方案 目前Visual Studio中最新版本的Xamarin.iO ...
- Xamarin迁移到 Unified API 注意事项
参考官方文档: Migrating to Unified API for Components #if __UNIFIED__ ... // Mappings Unified CoreGraphic ...
- Xamarin.iOS项目提示error MSB3174:”TargetFrameworkVersion”的值无效
Xamarin.iOS项目提示error MSB3174:”TargetFrameworkVersion”的值无效 错误信息:MSBulid\14.0\bin\Microsoft.Common.Cur ...
- 【Xamarin挖墙脚系列:Xamarin.IOS的程序的结构】
原文:[Xamarin挖墙脚系列:Xamarin.IOS的程序的结构] 开始熟悉Xamarin在开发IOS的结构!!!!!!! 先看官方 这个是以一个单页面的程序进行讲述的. 1 程序引用的程序集,核 ...
- Xamarin.iOS,AOT,JIT,Limitations
Since applications on the iPhone using Xamarin.iOS are compiled to static code, it is not possible t ...
- Visual Studio + C# + Xamarin = iOS/Android/Windows Apps
Visual Studio 跨平台開發實戰 (1) -- Hello Xamarin! 前言 應用程式發展的腳步,從來沒有停過.從早期的 Windows 應用程式, 到網路時代的 web 應用程式,再 ...
- Xamarin iOS开发实战第1章使用C#编写第一个iOS应用程序
Xamarin iOS开发实战第1章使用C#编写第一个iOS应用程序 C#原本是用来编写Windows以及Windows Phone的应用程序.自从Xamarin问世后.C#的作用就发生了非常大的变化 ...
- Xamarin.iOS开发初体验
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAAA+CAIAAAA5/WfHAAAJrklEQVR4nO2c/VdTRxrH+wfdU84pW0
- xamarin IOS 报错处理: an error occurred on client Build420719 while
xamarin IOS 开发时如果报错如下: an error occurred on client Build420719 while...... 出现如下问题时,可能是1.丢失文件2.没有包括在项 ...
随机推荐
- 3.从Node.js操作MongoDB文档
1.更新文档结构,而非SQL 2.数据库更新运算符 在MongoDB中执行对象的更新时,需要确切的指定需要改变什么字段.需要如何改变.不像SQL语句建立冗长的查询字符串来定义更新. MongoDB中可 ...
- ecshop后台增加|添加商店设置选项和使用方法详解
有时候我们想在Ecshop后台做个设置.radio.checkbox 等等来控制页面的显示,看看Ecshop的设计,用到了shop_config这个商店设置功能 Ecshop后台增加|添加商店设置选项 ...
- 安装Yeoman,遇到的问题
在安装Yeoman遇到了一些报错,具体的步骤就不多说了,直接上码,具体的两处报错的地方. 第一个,创建webapp,直接报权限的错误,这时才留意到在它之前还有一个错误. [root@iZ289zd8c ...
- NPOI导出EXCEL 打印设置分页及打印标题
在用NPOI导出EXCEL的时候设置分页,在网上有查到用sheet1.SetRowBreak(i)方法,但一直都没有起到作用.经过研究是要设置 sheet1.FitToPage = false; 而 ...
- python之OS模块详解
python之OS模块详解 ^_^,步入第二个模块世界----->OS 常见函数列表 os.sep:取代操作系统特定的路径分隔符 os.name:指示你正在使用的工作平台.比如对于Windows ...
- Linux之tomcat日志管理
tomcat 的日志输出catalina.out,变大,可使用下面方式解决. cronolog. http://blog.csdn.net/huang_xw/article/details/61942 ...
- 【Java EE 学习 49 上】【Spring学习第一天】【基本配置】
一.HelloWorld 需要的jar文件(以2.5.5为例):spring.jar,common-logging.jar 1.新建类com.kdyzm.spring.helloworld.Hello ...
- [转]js 将图片连接转换称base64格式
参考:http://blog.csdn.net/wyyfwm/article/details/45917255 我们把图像文件的内容直接写在了HTML 文件中,这样做的好处是,节省了一个HTTP 请求 ...
- 特征描述之LBP
LBP 在数字图像处理和模式识别领域,LBP指局部二值模式,英文全称:Local Binary Patterns.最初功能为辅助图像局部对比度,并不是一个完整的特征描述子. 后来提升为一种有效的纹理描 ...
- devexpress 安装及破解
安装dx DXperience-10.1.4 破解文件下载