x向右为正,y向下为正
1.y<0
UILabel *label=[[UILabelalloc] initWithFrame:CGRectMake(40,40, 250,50)];
label.backgroundColor=[UIColorclearColor];
label.textColor=[UIColorredColor];
label.text=@"和合谷";
label.shadowColor=[UIColorblueColor];
label.shadowOffset=CGSizeMake(0, -3);

第二.y>0
UILabel *label=[[UILabelalloc] initWithFrame:CGRectMake(40,40, 250,50)];
label.backgroundColor=[UIColorclearColor];
label.textColor=[UIColorredColor];
label.text=@"和合谷";
label.shadowColor=[UIColorblueColor];
label.shadowOffset=CGSizeMake(0,3);

第三、x>0
UILabel *label=[[UILabelalloc] initWithFrame:CGRectMake(40,40, 250,50)];
label.backgroundColor=[UIColorclearColor];
label.textColor=[UIColorredColor];
label.text=@"和合谷";
label.shadowColor=[UIColorblueColor];
label.shadowOffset=CGSizeMake(3,0);
[self.viewaddSubview:label];

第四、x<0
UILabel *label=[[UILabelalloc] initWithFrame:CGRectMake(40,40, 250,50)];
label.backgroundColor=[UIColorclearColor];
label.textColor=[UIColorredColor];
label.text=@"和合谷";
label.shadowColor=[UIColorblueColor];
label.shadowOffset=CGSizeMake(-3,0);

网友评论