Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要添加阴影的 CALayer。我努力了
myLayer.shadowColor = [[UIColor whiteColor] CGColor]; myLayer.shadowOpacity = 1; myLayer.shadowOffset = CGSizeMake(0, 0); myLayer.shadowRadius = 1;
这只会给我一个模糊的阴影。我怎样才能得到一个坚实的?
更改 shadowOffset 值并检查将阴影颜色更改为非白色
myLayer.shadowOffset = CGSizeMake(X,X);
(X = 任何适合您要求的值)
例如
myLayer.shadowOffset = CGSizeMake(0,2);