X Tutup
The Wayback Machine - https://web.archive.org/web/20201022170157/https://github.com/PierrePerrin/ShadowView/issues/8
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

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

addSubview so lag #8

fung199609 opened this issue Apr 21, 2020 · 2 comments

Comments

@fung199609
Copy link

@fung199609 fung199609 commented Apr 21, 2020

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 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

@fung199609 fung199609 commented Jun 30, 2020

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup