我給CALayer
添加了陰影,但是我希望這個陰影只能在視圖的左側和右側。有誰知道這是否可能?左右側的陰影
目前,我加入陰影這樣的:
view.layer.shadowColor = [UIColor blackColor].CGColor;
view.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
view.layer.shadowOpacity = 1.0f;
view.layer.shadowRadius = 4.0f;
view.layer.shadowPath = [UIBezierPath bezierPathWithRect:view.bounds].CGPath;
// Left Shadow view.layer.shadowOffset = CGSizeMake( - 1.0f,0.0f); //右影 view.layer.shadowOffset = CGSizeMake(1.0f,0.0f); – Bala 2012-08-08 15:51:03