Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

SVGAPlayer初始化的-init和-initWithFrame:存在重复调用-initPlayer的问题 #169

Open
captain-black opened this issue Oct 16, 2021 · 0 comments

Comments

@captain-black
Copy link

我子类继承了SVGAPlayer,然后在-initWithFrame:里初始化并设置self.contentMode, 但是发现总是会被覆盖成UIViewContentModeTop。由于UIView的初始化顺序是-init -> -initWithFrame: , 所以我在子类中-initWithFrame:设置contentMode之后,还会返回到-init里走了一遍-initPlayer, 所以contentMode又被设置成默认的UIViewContentModeTop了。

解决这个问题方法:
SVGAPlayer不必重载-init方法了

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant