UISwitch - 从开/关切换到是/否 [英] UISwitch - change from on/off to yes/no

查看:130
本文介绍了UISwitch - 从开/关切换到是/否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道我可以将文本标签的开启和关闭更改为是和否。

does anyone know of a way I can change the text label for on and off to yes and no.

我用

            ((UILabel *)[[[[[[switchControl subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Yes";
        ((UILabel *)[[[[[[switchControl subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"No";

然而,随着iOS 4.2的发布,不再支持此功能(这可能不推荐无论如何,通过Apple)

However, with the release of iOS 4.2, this is no longer supported (this probably wasn't recommended by Apple anyway)

我的客户坚持是/否开关。我很感激任何建议!

My client is insisting on yes/no switches. I'd appreciate any advice!

非常感谢

推荐答案

你需要为此实现自定义UISwitch。或使用已实施的:) :(查看此SO问题这篇文章

You need to implement your custom UISwitch for that. Or use one of already implemented :) (check this SO question and this post)

这篇关于UISwitch - 从开/关切换到是/否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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