iOS 7.1:UIButton的选定标题不起作用 [英] IOS 7.1: UIButton's selected title not working

查看:62
本文介绍了iOS 7.1:UIButton的选定标题不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我已将iPhone操作系统升级为 iOS 7.1 .

Today I upgraded my iPhone OS to iOS 7.1.

在新的iOS中一切看起来都不错,但是我正在开发的应用程序中关于 UIButtons 的问题很关键.

Everything looks good in the new iOS, but I have a critical issue regarding UIButtons in the app I'm working on.

每个按钮都没有选择状态.例如,选择时 Like 按钮的标题为"Liked" ,但当前不显示.在每种状态下,按钮仅包含无背景/图像的文本.我尝试在 Xcode 5.1 中构建和测试该应用,但仍然无法在按钮中看到所选状态.

The selected state was gone in every button. For instance, Like button has title of "Liked" when selected but it's not shown at all when selected right now. Buttons have only text without background/image in every state. I tried to build and test the app in Xcode 5.1, but still can't see the selected states in buttons.

还有其他人有这个问题,或者可以帮助我解决这个问题吗?

Does anyone else have this issue or could help me solve it?

推荐答案

已解决!最终,我得以修复它,这是由于 iOS 7.1 中的 UIButton 行为得到了改进.

Fixed it! Finally I was able to fix it and it was because of improvement of UIButton behaviour in iOS 7.1.

They just started rendering round-rected shape filled with tint color when UIButton is selected.

They just started rendering round-rected shape filled with tint color when UIButton is selected.

iOS 7 中,它是半透明的,我记得我把透明的颜色只是为了使按钮清晰可见.这就是问题所在,它们在按钮周围绘制了透明矩形,选择后我们什么都看不到!希望这对遇到类似问题的人有所帮助.

It was semi-transparent one in iOS 7 and I remember that I put clear color just to make the buttons clear to see. That was the issue and they rendered transparent rectangle around the buttons and we're unable to see anything when selected at all! Hope this would help others who have the similar issues.

这篇关于iOS 7.1:UIButton的选定标题不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆