简体   繁体   English

快速自定义UISegmentedcontrol和UISwitch iOS 9无需安装Pod

[英]Customization UISegmentedcontrol and UISwitch iOS 9 in swift without installing pods

3 days I am searching internet for Customization UISegmentedcontrol and UISwitch iOS 9 in swift. 3天后,我正在Internet上迅速搜索Customization UISegmentedcontrol和UISwitch iOS 9。 I got switch and segmented control, so I want to implement some fancy design with images etc... but I cant find anything without installing some old cocoa pods in obj-C. 我有开关和分段控制,所以我想用图像等实现一些精美的设计...但是如果不在obj-C中安装一些旧的可可豆荚,我什么也找不到。 Is there native way to custimizate them? 有本地化方式对其进行自定义吗? some fresh new tutorial for this issue? 一些新的新教程来解决这个问题? As well, I dont want to programmatically set them. 同样,我也不想以编程方式设置它们。

Thanks in advance. 提前致谢。

PS I hope there wont be down vote :) PS我希望不会被否决:)

EDITED: 编辑:

图片1

图片2

图片3

Both UISwitch and UISegmentedControl have fairly powerful inbuilt customisation capabilities, such as allowing you to set background images, tint colour, text attributes, You can also try subclassing or extending these control for even more granular control. UISwitch和UISegmentedControl都具有相当强大的内置自定义功能,例如允许您设置背景图像,色调颜色,文本属性。您还可以尝试对这些控件进行子类化或扩展,以获得更精细的控件。 Try referring to these docs: 尝试参考以下文档:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISwitch_Class/index.html#//apple_ref/doc/uid/TP40006784-CH3-SW7 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISwitch_Class/index.html#//apple_ref/doc/uid/TP40006784-CH3-SW7

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISegmentedControl_Class/index.html#//apple_ref/doc/uid/TP40006807-CH3-SW33 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISegmentedControl_Class/index.html#//apple_ref/doc/uid/TP40006807-CH3-SW33

:) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM