1
我剛剛更新了應用程序從Xcode 5到Xcode 6沒有任何更改,沒有問題。但是,在iOS 8設備上運行應用程序時,我的自定義mpVolumeView
現在的操作系統默認軌道和拇指覆蓋了我的自定義軌道和拇指。自定義mpVolumeView也顯示默認跟蹤和拇指在iOS 8
我爲音量調節不變的代碼是這樣的:
// Set up volume control
[[self mpVolumeView] setBackgroundColor:[UIColor clearColor]];
MPVolumeView *myVolumeView = [[MPVolumeView alloc] initWithFrame: [[self mpVolumeView] bounds]];
[[self mpVolumeView] addSubview:myVolumeView];
for (UIView *view in [myVolumeView subviews]) {
if ([[[view class] description] isEqualToString:@"MPVolumeSlider"])
{ // Find the volume view slider
volumeViewSlider = (UISlider *) view;
}
}
UIImage *volumeLeftCap = [[UIImage imageNamed:@"volume-left-cap.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 16, 0, 0)];
UIImage *volumeRightCap = [[UIImage imageNamed:@"volume-right-cap.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 16)];
[volumeViewSlider setMinimumTrackImage:volumeLeftCap forState:UIControlStateNormal];
[volumeViewSlider setMaximumTrackImage:volumeRightCap forState:UIControlStateNormal];
// Note: on iOS7 it is necessary to set the thumb image last or the thumb will
// be drawn under the slider, on iOS6 the order didn't seem to matter.
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1)
{ // iOS 7.0 or greater
[volumeViewSlider setThumbImage: [UIImage imageNamed:@"thumb-iOS7.png"]
forState:UIControlStateNormal];
}
else {
// Earlier versions of iOS...
[volumeViewSlider setThumbImage: [UIImage imageNamed:@"thumb.png"]
forState:UIControlStateNormal];
}
和新的結果可以在這裏看到:
volume control with two tracks and thumbs
有沒有人見過這個問題,或者我應該提交錯誤報告??