2015-09-01 57 views

回答

1

目標C

我做到了通過使用這樣的:

self.yourSlider.frameRotation = 90.0; 
CGRect frame = self.yourSlider.frame; 
float tmp = frame.size.height; 
frame.size.height = frame.size.width; 
frame.size.width = tmp; 
[self.yourSlider setFrame:frame]; 
[self.yourSlider setWantsLayer:TRUE]; 

斯威夫特

我猜雨燕的版本將是:

self.yourSlider.frameRotation = 90.0 
var frame: CGRect = self.yourSlider.frame 
var tmp: Float = frame.size.height 
frame.size.height = frame.size.width 
frame.size.width = tmp 
self.yourSlider.frame = frame 
self.yourSlider.setWantsLayer(TRUE) 
+0

UISlider有改造財產,但我可以在NSSlider中找到它。 –

+0

我注意到了,只是編輯了代碼! – JorisH

+0

哈哈,奧克,所以這個作品? – JorisH