記錄一下今天某羣的聊天記錄,一些算是經驗吧,以後有用的。呵呵~
動畫的時候 如果加陰影 會卡頓的
A 10:59:13
_toView.layer.shadowColor = [[UIColor blackColor] CGColor];
_toView.layer.shadowOffset = CGSizeMake(0.5, 0.5);
_toView.layer.shadowRadius = 10;
_toView.layer.shadowOpacity = 0.6; 這種會卡頓的
B 10:59:21
你還要加東西
A 10:59:21
_toView.layer.shadowPath = [UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
_toView.layer.shadowColor = [[UIColor blackColor] CGColor];
_toView.layer.shadowOffset = CGSizeMake(0.5, 0.5);
_toView.layer.shadowRadius = 10;
_toView.layer.shadowOpacity = 0.6;
B 10:59:23
我給你找找
A 10:59:25
這樣就不會了
B) 10:59:40
[UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
必須加這個
A 10:59:46
指定一下 陰影的path
YES
餅子~~~~
I LOVE YOU
B 10:59:56
我當時找這個問題找了一天
A 10:59:59
只是 沒人提到...
C 11:00:02
陰影,耗內存的,
B 11:00:25
你在執行動畫的時候一直在重花陰影
A 11:00:27
[UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
加了這個基本卡頓消失了~~
是的
也就是爲什麼有的軟件加陰影 不卡 有的很卡
就是沒有指定這句話~
_toView.layer.shadowColor = [[UIColor blackColor] CGColor];
_toView.layer.shadowOffset = CGSizeMake(0.5, 0.5);
_toView.layer.shadowRadius = 10;
_toView.layer.shadowOpacity = 0.6; 這種會卡頓的
B 10:59:21
你還要加東西
A 10:59:21
_toView.layer.shadowPath = [UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
_toView.layer.shadowColor = [[UIColor blackColor] CGColor];
_toView.layer.shadowOffset = CGSizeMake(0.5, 0.5);
_toView.layer.shadowRadius = 10;
_toView.layer.shadowOpacity = 0.6;
B 10:59:23
我給你找找
A 10:59:25
這樣就不會了
B) 10:59:40
[UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
必須加這個
A 10:59:46
指定一下 陰影的path
YES
餅子~~~~
I LOVE YOU
B 10:59:56
我當時找這個問題找了一天
A 10:59:59
只是 沒人提到...
C 11:00:02
陰影,耗內存的,
B 11:00:25
你在執行動畫的時候一直在重花陰影
A 11:00:27
[UIBezierPath bezierPathWithRect:_toView.bounds].CGPath;
加了這個基本卡頓消失了~~
是的
也就是爲什麼有的軟件加陰影 不卡 有的很卡
就是沒有指定這句話~