0
此代碼的iOS 8.0設備工作正常,但在iOS的9.0總是讓滑塊值0.000 ...如何更改iOS9中的音量?
(void) volumeUp{
MPVolumeView * volumeView = [[MPVolumeView alloc] init];
//find the volumeSlider
UISlider* volumeViewSlider = nil;
for (UIView *view in [volumeView subviews]){
if ([view.class.description isEqualToString:@"MPVolumeSlider"]){
volumeViewSlider = (UISlider*)view; // volumeViewSlider always 0.000
break;
}
}
[volumeViewSlider setValue: [volumeViewSlider value] + 0.0625 animated:YES];
[volumeViewSlider sendActionsForControlEvents:UIControlEventTouchUpInside];
}
我怎樣才能解決呢?我需要每次調高音量0.0625。
謝謝!
是volumeViewSlider也許零for循環後? – onnoweb