Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addSubview so lag #8

Closed
fung199609 opened this issue Apr 21, 2020 · 2 comments
Closed

addSubview so lag #8

fung199609 opened this issue Apr 21, 2020 · 2 comments

Comments

@fung199609
Copy link

When I add the shadowContainerView be the subview.
It's so slow and feel lag.

ShadowView *shadowContainerView = [[ShadowView alloc] init];
shadowContainerView.frame = self.bounds;
shadowContainerView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
shadowContainerView.shadowOffset = CGSizeMake(0, self.shadowOffset);
shadowContainerView.shadowRadius = self.radius;
shadowContainerView.shadowScale = 0.9;

CGRect frame = self.frame;
frame.size.height = self.height+self.shadowOffset;
self.frame = frame;

[self addSubview: shadowContainerView]; //this line make the program so slow and lag
[shadowContainerView addSubview:_frontImgView];
_frontImgView.center = shadowContainerView.center;

@PierrePerrin
Copy link
Owner

PierrePerrin commented May 26, 2020

Hi, sorry for the late response. Do you actually found a way to make things smoother?
At which moment do you add the subview in your View?
The shadow radius is a demanding parameter, did you try to low it down?

Pierre

@fung199609
Copy link
Author

no. it still lag about 1 second

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

No branches or pull requests

2 participants