回答
有一個onTintColor
屬性,你可以在UISwitch設置。如果您還需要更改手柄圖像,請查看DCRoundSwitch。
感謝您的幫助H2CO3.DCRoundSwitch真的很棒...他們沒有給出任何選項來定製旋鈕圖像..我們只能改變尺寸& tintcolor的開關... – niks
@niks因爲它是開源的,你可以修改它來定製圖像。 (順便說一句,你可以upvote /接受回答,幫助。) – 2012-09-13 07:54:32
看@ dcroundswitch的例子。它顯示瞭如何定製旋鈕 –
- 1. 帶圖像的自定義UISwitch
- 2. 自定義UISwitch圖形?
- 3. 自定義UISwitch?
- 4. UISwitch自定義
- 5. UIActivity與自定義圖像
- 6. 自定義UIButton與圖像
- 7. 自定義UIProgressView與圖像
- 8. MonoTouch自定義UISwitch顏色
- 9. UISwitch在自定義accessoryView的
- 10. 影像圖與自定義圖標
- 11. 與圖像自定義列表視圖
- 12. 如何使用我的自定義.png自定義UISwitch?
- 13. 自定義UIAlertView中與圖像
- 14. 自定義標題與圖像
- 15. Silverlight ProgressBar與自定義圖像磚
- 16. 自定義按鈕與多個圖像
- 17. 自定義MKAnnotationView與多個圖像
- 18. 自定義網格與圖像
- 19. UICollectionViewCell與圖像沒有自定義類
- 20. xaml自定義進度條與圖像
- 21. 自定義Google Plus One與圖像
- 22. 另一個自定義的UISwitch問題
- 23. 如何創建自定義的UISwitch?
- 24. 應用自定義圖像大小與普通圖像標籤
- 25. Android ListView與來自相機或圖庫的自定義圖像
- 26. 自定義圖像庫
- 27. MKPinAnnotationView自定義圖像
- 28. MKAnnotation的自定義圖像
- 29. 自定義UIButton圖像iOS
- 30. 自定義MKMapPin圖像
http://developer.apple.com/library/ios/ipad/#documentation/uikit/reference/UISwitch_Class/Reference/Reference.html – 2012-09-13 06:00:42
這是一篇很好的博客文章:http://www.raywenderlich .com/23424/photoshop-for-developers-creating-a-custom-uiswitch – kschaeffler