UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.titleLabel.shadowColor = [UIColor blackColor]; btn.titleLabel.shadowOffset = CGSizeMake(1, 1); 当我在ios7上运行它时,按钮根本没有阴影.提出你的建议. 尝试使
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.titleLabel.shadowColor = [UIColor blackColor]; btn.titleLabel.shadowOffset = CGSizeMake(1, 1);
当我在ios7上运行它时,按钮根本没有阴影.提出你的建议.
尝试使用以下代码来获取按钮标题的阴影[button setTitleShadowColor:[UIColor blackColor] forState:UIControlStateNormal];
如果你想在按钮上给阴影,那么请阅读以下链接.
Add border and shadow to the buttons