gpt4 book ai didi

c# - 如何在 Xamarin.iOS 中实现 +(Class) layerClass?

转载 作者:太空狗 更新时间:2023-10-29 22:16:22 25 4
gpt4 key购买 nike

我在许多演示 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com