2013-10-02 34 views
0

我正在使用下面的代碼來獲取按鈕標題標籤的陰影。UIButton titlelabel shadowoffset屬性在ios 7中表現不正確

theCuLabel.titleLabel.shadowColor=[UIColor blackColor]; 
theCuLabel.titleLabel.shadowOffset=CGSizeMake(-3.0,2.5); 

在IOS 6的正常工作,像下面

但在IOS 7的預期像下面

我沒有找到這個解決方案沒有工作,任何一個可以告訴我的解決辦法或者IOS 7中發生的任何更新。

在此先感謝...

+1

如果你在iOS 7中使用陰影,你做錯了。 – WrightsCS

+0

嗨謝謝你4r你的回覆,那麼如何給uibuttontitle標籤留下一個陰影..在ios 7中應該支持4r ios 6&5以及 –

+0

@WrightsCS如何在ios 7+中設置文本陰影顏色? – iMemon

回答

2
[button setTitleShadowColor:[UIColor blackColor] forState:UIControlStateNormal]; 

這是設置一個UIButton陰影顏色的正確方法。 我已經試過這個,並在所有版本中工作。

+0

grt非常感謝,它現在在所有版本中工作...小變化但grt –