ios - 使用 MPMusicPlayerController 控制音量
<p><p>我正在使用 MPMusicPlayerController 通过我的 slider 更改系统音量:</p>
<pre><code>-(void)viewDidLoad{
MPMusicPlayerController musicPlayer = ;
[ addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];
}
</code></pre>
<p>然后我实现了以下方法来改变声音:</p>
<pre><code>-(IBAction)sliderValueChanged:(UISlider *)sender{
;
}
- (void)volumeChanged:(NSNotification *)notification
{
float volume =[[ objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"]floatValue];
;
}
</code></pre>
<p>当我用搜索器改变音量时,它显示系统音量 Controller ,有什么方法可以防止显示?</p>
<p>编辑:MPVolume 默认图像质量好但有点大!
<a href="/image/CzF7x.jpg" rel="noreferrer noopener nofollow"><img src="/image/CzF7x.jpg" alt="enter image description here"/></a> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>这些是我使用的图片 - 我只包含了 1x 尺寸 - 拇指是 54 x 30</p>
<pre><code> forState:UIControlStateNormal];
forState:UIControlStateNormal];
forState:UIControlStateNormal];
</code></pre>
<p> <a href="/image/ivoAq.png" rel="noreferrer noopener nofollow"><img src="/image/ivoAq.png" alt="master_volume_bar"/></a> </p>
<p> <a href="/image/jMtMu.png" rel="noreferrer noopener nofollow"><img src="/image/jMtMu.png" alt="grey_volume_bar"/></a> </p>
<p> <a href="/image/kzbVQ.png" rel="noreferrer noopener nofollow"><img src="/image/kzbVQ.png" alt="volume_thumb"/></a> </p></p>
<p style="font-size: 20px;">关于ios - 使用 MPMusicPlayerController 控制音量,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/32046514/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/32046514/
</a>
</p>
页:
[1]