如何设置UISwitch边框颜色? [英] How to set UISwitch border color?

查看:928
本文介绍了如何设置UISwitch边框颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用已完成:

[[UIView appearance] setTintColor:[UIColor whiteColor]];

以下是 时的情况:

off

我需要制作 UISwitch 边框在Settings.app中可见:

I need to make UISwitch border visible like in Settings.app:

推荐答案

您的 [[UIView外观] setTintColor:[UIColor whiteColor ]]; 干扰了交换机的色调颜色。设置色调颜色的命令是 self.mySwitch.tintColor = [UIColor grayColor]; ,它设置用于在关闭时为开关的轮廓着色的颜色。

Your [[UIView appearance] setTintColor:[UIColor whiteColor]]; is interfering with the tint color of your switch. The command to set the tint color is self.mySwitch.tintColor = [UIColor grayColor]; which sets the color used to tint the outline of the switch when it is turned off.

这篇关于如何设置UISwitch边框颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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