作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在许多演示 CAEmitterLayer
使用的项目中都看到了这一点,但它如何转化为 MonoTouch aka Xamarin.iOS?
+ (Class) layerClass
{
//configure the UIView to have emitter layer
return [CAEmitterLayer class];
}
我知道我可以使用 UIView.Layer.AddSubLayer()
但似乎会影响性能。
最佳答案
我认为您需要像下面这样将它暴露给 Obj 运行时。
[Export ("layerClass")]
public static Class LayerClass () {
return new Class (typeof (CAEmitterLayer));
}
有关更多信息,请查看 MonoTouch... CATiledLayer example .
希望对您有所帮助。
附言检查代码。我在没有 Xamarin Studio 支持的情况下编写。
关于c# - 如何在 Xamarin.iOS 中实现 +(Class) layerClass?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16780356/
我是一名优秀的程序员,十分优秀!