0
このコードを使用して、すべてのマイデバイスの位置を正しく設定します。私がスライダーの位置を4秒間に設定すると、iPhone 6+の位置が変わるという問題があります。私の他のデバイスにも同じことが起こります。すべてのデバイスにスライダを完全に配置させるにはどうすればよいですか?私はspritekit btwですべてのデバイスでspritekit内のUISliderの位置を設定できませんでしたか?
//iphone4s
if UIDevice.currentDevice().userInterfaceIdiom == .Phone && ScreenSize.maxLength < 568.0 {
middleSlider = UISlider(frame: CGRectMake(180, 50, 150, 20))
middleSlider.tintColor = UIColor.whiteColor()
middleSlider.setThumbImage(UIImage(named: "thumb2"), forState: UIControlState.Normal)
self.view?.addSubview(middleSlider)
bottomAudioControlBg.position = CGPointMake(self.size.width/2, self.size.height/7)
}
//iphone5
if UIDevice.currentDevice().userInterfaceIdiom == .Phone && ScreenSize.maxLength == 568.0 {
}
//iphone6
if UIDevice.currentDevice().userInterfaceIdiom == .Phone && ScreenSize.maxLength == 667.0 {
}
//iphone6+
if UIDevice.currentDevice().userInterfaceIdiom == .Phone && ScreenSize.maxLength == 736.0 {
middleSlider = UISlider(frame: CGRectMake(255, 50, 150, 20))
middleSlider.tintColor = UIColor.whiteColor()
middleSlider.setThumbImage(UIImage(named: "thumb2"), forState: UIControlState.Normal)
self.view?.addSubview(middleSlider)
}
//ipad
if UIDevice.currentDevice().userInterfaceIdiom == .Pad && ScreenSize.maxLength == 1024.0 {
}
//ipadpro
if UIDevice.currentDevice().userInterfaceIdiom == .Pad && ScreenSize.maxLength == 1366.0 {
}
大丈夫それが動作します。ありがとうございました! – coding22
私は1つの質問をipadのためにもこの仕事はありますか? – coding22
私はipadのためにそれを試して、スライダは、iphoneのような正しい位置にありません。 – coding22