回答
有一個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. 自定義UIProgressView與圖像
- 6. UIActivity與自定義圖像
- 7. 自定義UIButton與圖像
- 8. UISwitch在自定義accessoryView的
- 9. MonoTouch自定義UISwitch顏色
- 10. 影像圖與自定義圖標
- 11. 與圖像自定義列表視圖
- 12. 自定義圖像
- 13. 如何使用我的自定義.png自定義UISwitch?
- 14. xaml自定義進度條與圖像
- 15. 自定義按鈕與多個圖像
- 16. 單選按鈕與自定義圖像
- 17. 與Google+共享自定義圖像
- 18. Silverlight ProgressBar與自定義圖像磚
- 19. 與自定義圖像的評級欄
- 20. 自定義Google Plus One與圖像
- 21. UICollectionViewCell與圖像沒有自定義類
- 22. 自定義MKAnnotationView與多個圖像
- 23. 自定義網格與圖像
- 24. 自定義UIAlertView中與圖像
- 25. 自定義標題與圖像
- 26. 自定義arrayadapter listview與圖像
- 27. 創建我的自定義UISwitch
- 28. 如何創建自定義的UISwitch?
- 29. 另一個自定義的UISwitch問題
- 30. 應用自定義圖像大小與普通圖像標籤
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