ios – 在UIBarButtonitem类型的对象上找不到属性层

ios – 在UIBarButtonitem类型的对象上找不到属性层,第1张

概述我试图将此动画应用于UIBarButtonItem: CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"]; theAnimation.duration=1.0; theAnimation.repeatCount=HUGE_VALF; 我试图将此动画应用于UIbarbuttonItem:

CABasicAnimation *theAnimation;    theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];    theAnimation.duration=1.0;    theAnimation.repeatCount=HUGE_VALF;    theAnimation.autoreverses=YES;    theAnimation.fromValue=[NSNumber numberWithfloat:1.0];    theAnimation.tovalue=[NSNumber numberWithfloat:0.5];    [plusbutton.layer addAnimation:theAnimation forKey:@"animateOpacity"];

但我得到了最后一行代码标题中报告的错误.如何访问barbuttonItem的图层?

解决方法 条形按钮项不是视图,也没有图层.

假设您没有在系统项上尝试此 *** 作,请改为访问项目的customVIEw图层.

总结

以上是内存溢出为你收集整理的ios – 在UIBarButtonitem类型的对象找不到属性层全部内容,希望文章能够帮你解决ios – 在UIBarButtonitem类型的对象上找不到属性层所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1065041.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存