Swift, Xcode - 增加 UISwitch 的大小 [英] Swift, Xcode - Increasing the size of a UISwitch

查看:72
本文介绍了Swift, Xcode - 增加 UISwitch 的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使我的应用程序通用"(在 iPhone 和 iPad 上使用),并且我找到了增加除 UISwitches 之外的所有内容大小的方法.有什么办法吗?

I am making my app 'universal' (used on iPhone and iPad) and I have found ways of increasing the size of everything except for UISwitches. Is there a way of doing so?

非常感谢任何帮助.

推荐答案

根据这个回答由用户mxg,只需使用以下代码:

According to this answer by the user mxg, just use the following code:

 mySwitch.transform = CGAffineTransformMakeScale(0.75, 0.75)

当然,您必须将 mySwitch 更改为变量/IBOutlet 的名称.

Of course, you have to change mySwitch to whatever the name of your variable/IBOutlet is.

这篇关于Swift, Xcode - 增加 UISwitch 的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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