本文介绍了Uibutton titlelabel shadowoffset属性在ios 7中表现不正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码获取按钮标题标签的阴影。

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

在IOS 6中,它的工作正常如下





我没有找到解决方案,任何人都可以告诉我解决方案或IOS 7中的任何更新发生在这件事上。



在此先感谢...

解决方案
  [button setTitleShadowColor:[UIColor blackColor] forState:UIControlStateNormal]; 

这是为UIButton设置阴影颜色的正确方法。
我试过这个并且在所有版本中都有效。


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...

解决方案
[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.

这篇关于Uibutton titlelabel shadowoffset属性在ios 7中表现不正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 08:45