Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我想用Button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生. 显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行? import UIKitclass MyViewController : UIViewControlle 我想用button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生.

显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行?

import UIKitclass MyVIEwController : UIVIEwController {    let animatedVIEw = UIVIEw()    overrIDe func loadVIEw() {        let vIEw = UIVIEw()        vIEw.backgroundcolor = .white        // Add a button        let button = UIbutton(type: .system)        button.frame = CGRect(x: 150,y: 200,wIDth: 200,height: 50)        button.setTitle("Animate",for: .normal)        button.addTarget(self,action: #selector(tap),for: .touchUpInsIDe)        // Set color and frame of the vIEw,that is animated.        animatedVIEw.backgroundcolor = UIcolor.blue        animatedVIEw.frame = CGRect(x: 50,y: 50,wIDth: 50,height: 50)        // Add the vIEws to the vIEw hIErarchy        vIEw.addSubvIEw(animatedVIEw)        vIEw.addSubvIEw(button)        self.vIEw = vIEw    }    /// On Tap create an animation,that changes the position of the animated vIEw.    @objc func tap() {        let originalY = animatedVIEw.layer.position.y        let animation = CABasicAnimation(keyPath: "position.y")        animation.fromValue = originalY        animation.tovalue = 300.0        animation.duration = 1.0        animatedVIEw.layer.add(animation,forKey: "positionAnimation")    }}

Can you try this code with iOS 11.2.9,I have tested your code and it’s working fine.

// MARK: Animationspublic extension CALayer {    var ani: CAAnimation {        let startPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.startPoint))        startPointAnim.fromValue = CGPoint(x: 0,y: 0.0)        startPointAnim.tovalue = CGPoint(x:0,y: 300)        let endPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.endPoint))        endPointAnim.fromValue = CGPoint(x: 0,y: 0)        endPointAnim.tovalue = CGPoint(x:2,y: 300)        let animgroup = CAAnimationGroup()        animgroup.animations = [startPointAnim,endPointAnim]        animgroup.duration = 1.0        animgroup.timingFunction = camediatimingFunction(name: kcamediatimingFunctionEaseIn)                    return animgroup    }    func playAnimation(_ anim: SkeletonLayerAnimation,key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { add(anim(self),forKey: key) }) {                            [+++].playAnimation(anim,key: key)        }    }    func stopAnimation(forKey key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { removeAnimation(forKey: key) }) {                            [+++].stopAnimation(forKey: key)        }    }}
总结

以上是内存溢出为你收集整理的swift – 动画滞后于设备,但不在模拟器中全部内容,希望文章能够帮你解决swift – 动画滞后于设备,但不在模拟器中所遇到的程序开发问题。

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

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我想用Button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生. 显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行? import UIKitclass MyViewController : UIViewControlle 我想用button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生.

显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行?

import UIKitclass MyVIEwController : UIVIEwController {    let animatedVIEw = UIVIEw()    overrIDe func loadVIEw() {        let vIEw = UIVIEw()        vIEw.backgroundcolor = .white        // Add a button        let button = UIbutton(type: .system)        button.frame = CGRect(x: 150,y: 200,wIDth: 200,height: 50)        button.setTitle("Animate",for: .normal)        button.addTarget(self,action: #selector(tap),for: .touchUpInsIDe)        // Set color and frame of the vIEw,that is animated.        animatedVIEw.backgroundcolor = UIcolor.blue        animatedVIEw.frame = CGRect(x: 50,y: 50,wIDth: 50,height: 50)        // Add the vIEws to the vIEw hIErarchy        vIEw.addSubvIEw(animatedVIEw)        vIEw.addSubvIEw(button)        self.vIEw = vIEw    }    /// On Tap create an animation,that changes the position of the animated vIEw.    @objc func tap() {        let originalY = animatedVIEw.layer.position.y        let animation = CABasicAnimation(keyPath: "position.y")        animation.fromValue = originalY        animation.tovalue = 300.0        animation.duration = 1.0        animatedVIEw.layer.add(animation,forKey: "positionAnimation")    }}

Can you try this code with iOS 11.2.9,I have tested your code and it’s working fine.

// MARK: Animationspublic extension CALayer {    var ani: CAAnimation {        let startPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.startPoint))        startPointAnim.fromValue = CGPoint(x: 0,y: 0.0)        startPointAnim.tovalue = CGPoint(x:0,y: 300)        let endPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.endPoint))        endPointAnim.fromValue = CGPoint(x: 0,y: 0)        endPointAnim.tovalue = CGPoint(x:2,y: 300)        let animgroup = CAAnimationGroup()        animgroup.animations = [startPointAnim,endPointAnim]        animgroup.duration = 1.0        animgroup.timingFunction = camediatimingFunction(name: kcamediatimingFunctionEaseIn)                    return animgroup    }    func playAnimation(_ anim: SkeletonLayerAnimation,key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { add(anim(self),forKey: key) }) {                            .playAnimation(anim,key: key)        }    }    func stopAnimation(forKey key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { removeAnimation(forKey: key) }) {                            [+++].stopAnimation(forKey: key)        }    }}
总结

以上是内存溢出为你收集整理的swift – 动画滞后于设备,但不在模拟器中全部内容,希望文章能够帮你解决swift – 动画滞后于设备,但不在模拟器中所遇到的程序开发问题。

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

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
swift – 动画滞后于设备,但不在模拟器中_app_内存溢出

swift – 动画滞后于设备,但不在模拟器中

swift – 动画滞后于设备,但不在模拟器中,第1张

概述我想用Button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生. 显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行? import UIKitclass MyViewController : UIViewControlle 我想用button触发CAAnimation.在游乐场和模拟器中,这完全符合我的要求.但是,当我在设备上运行相同的代码时,动画仅在短暂延迟后发生.

显然,这个问题只发生在iOS 11.2.6上.我更新了我的设备,现在无法重现该问题.任何人都可以确认或了解它如何在iOS 11.2.6上运行?

import UIKitclass MyVIEwController : UIVIEwController {    let animatedVIEw = UIVIEw()    overrIDe func loadVIEw() {        let vIEw = UIVIEw()        vIEw.backgroundcolor = .white        // Add a button        let button = UIbutton(type: .system)        button.frame = CGRect(x: 150,y: 200,wIDth: 200,height: 50)        button.setTitle("Animate",for: .normal)        button.addTarget(self,action: #selector(tap),for: .touchUpInsIDe)        // Set color and frame of the vIEw,that is animated.        animatedVIEw.backgroundcolor = UIcolor.blue        animatedVIEw.frame = CGRect(x: 50,y: 50,wIDth: 50,height: 50)        // Add the vIEws to the vIEw hIErarchy        vIEw.addSubvIEw(animatedVIEw)        vIEw.addSubvIEw(button)        self.vIEw = vIEw    }    /// On Tap create an animation,that changes the position of the animated vIEw.    @objc func tap() {        let originalY = animatedVIEw.layer.position.y        let animation = CABasicAnimation(keyPath: "position.y")        animation.fromValue = originalY        animation.tovalue = 300.0        animation.duration = 1.0        animatedVIEw.layer.add(animation,forKey: "positionAnimation")    }}

Can you try this code with iOS 11.2.9,I have tested your code and it’s working fine.

// MARK: Animationspublic extension CALayer {    var ani: CAAnimation {        let startPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.startPoint))        startPointAnim.fromValue = CGPoint(x: 0,y: 0.0)        startPointAnim.tovalue = CGPoint(x:0,y: 300)        let endPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradIEntLayer.endPoint))        endPointAnim.fromValue = CGPoint(x: 0,y: 0)        endPointAnim.tovalue = CGPoint(x:2,y: 300)        let animgroup = CAAnimationGroup()        animgroup.animations = [startPointAnim,endPointAnim]        animgroup.duration = 1.0        animgroup.timingFunction = camediatimingFunction(name: kcamediatimingFunctionEaseIn)                    return animgroup    }    func playAnimation(_ anim: SkeletonLayerAnimation,key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { add(anim(self),forKey: key) }) {                            .playAnimation(anim,key: key)        }    }    func stopAnimation(forKey key: String) {        recursiveSearch(inArray: skeletonSublayers,leafBlock: { removeAnimation(forKey: key) }) {                            .stopAnimation(forKey: key)        }    }}
总结

以上是内存溢出为你收集整理的swift – 动画滞后于设备,但不在模拟器中全部内容,希望文章能够帮你解决swift – 动画滞后于设备,但不在模拟器中所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/web/1033761.html

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

发表评论

登录后才能评论

评论列表(0条)

保存