简体   繁体   中英

drop shadow effect for text in iOS4

I've been trying to get the following effects on my text:

在此输入图像描述

I want to get the white border around my text, I tried playing around with the following, but it didn't work out

self.name.layer.shadowOpacity = 5.0;   
    self.name.layer.shadowRadius = 0.0;
    self.name.layer.shadowColor = [UIColor whiteColor].CGColor;
    self.name.layer.shadowOffset = CGSizeMake(0.0, -5.0);

What is the easiest way to achieve this?

try the following

self.name.layer.shadowColor = [label.textColor CGColor];
self.name.layer.shadowOffset = CGSizeMake(0.0, 0.0);
self.name.layer.shadowOpacity = 0.5;
self.name.layer.shadowRadius = 20.0;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM