Uibutton titlelabel shadowoffset property is not behaving properly in ios 7

爱⌒轻易说出口 提交于 2019-12-13 04:45:15

问题


I am using the below code to get a shadow to button title label.

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

In IOS 6 its working properly like below

But in IOS 7 its not working as expected like below

I didn't find solution for this, can any one tell me the solution or any update in IOS 7 that happened for this.

Thanks in Advance...


回答1:


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

this is the correct method to set the shadow color for a UIButton. I have tried this and is working in all versions.



来源:https://stackoverflow.com/questions/19142652/uibutton-titlelabel-shadowoffset-property-is-not-behaving-properly-in-ios-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!