3
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.titleLabel.shadowColor = [UIColor blackColor];
btn.titleLabel.shadowOffset = CGSizeMake(1, 1);
當我在ios7上運行這個按鈕時,該按鈕根本沒有陰影。給你的建議。iOS:UIButton的標題陰影顏色不起作用
u可以使用層爲 –
要在按鈕添加陰影或按鈕標題? – mengxiangjian
[Uibutton titlelabel shadowoffset屬性在ios 7中的行爲不正確]的可能的重複(http://stackoverflow.com/questions/19142652/uibutton-titlelabel-shadowoffset-property-is-not-behaving-properly-in-ios- 7) – rmaddy