gpt4 book ai didi

iphone - 隐藏电影播放器​​中的音量栏

转载 作者:行者123 更新时间:2023-11-29 04:19:29 26 4
gpt4 key购买 nike

如何隐藏电影播放器​​中的音量栏并保持其他控件显示(播放、前进...)?我想显示一些没有任何声音的视频,所以音量条完全没有用。

我可以这样做吗?

提前致谢

最佳答案

MPMoviePlayercontrolStyle 设置为 MPMovieControlStyleNone

moviePlayer.controlStyle = MPMovieControlStyleNone;

但这将从 View 中隐藏所有控件。

设置为MPMovieControlStyleNone后,如果要显示播放/暂停选项和搜索栏,则需要添加自定义控件。(我之前做过,我使用 slider 作为搜索栏,并将其与工具栏按钮一起放置在 UIToolBar 中。按钮用于播放/暂停选项)

MPMovieControlStyle

Constants describing the style of the playback controls.

enum { MPMovieControlStyleNone, MPMovieControlStyleEmbedded,
MPMovieControlStyleFullscreen, MPMovieControlStyleDefault = MPMovieControlStyleFullscreen }; typedef NSInteger MPMovieControlStyle;

Constants

MPMovieControlStyleNone

No controls are displayed.

Available in iOS 3.2 and later.

Declared in MPMoviePlayerController.h.

MPMovieControlStyleEmbedded

Controls for an embedded view are displayed. The controls include a start/pause button, a scrubber bar, and a button for toggling

between fullscreen and embedded display modes.

Available in iOS 3.2 and later.

Declared in MPMoviePlayerController.h.

MPMovieControlStyleFullscreen

Controls for fullscreen playback are displayed. The controls include a start/pause button, a scrubber bar, forward and reverse

seeking buttons, a button for toggling between fullscreen and embedded display modes, a button for toggling the aspect fill mode, and a Done button. Tapping the done button pauses the video and exits fullscreen mode.

Available in iOS 3.2 and later.

Declared in MPMoviePlayerController.h.

MPMovieControlStyleDefault

Fullscreen controls are displayed by default.

Available in iOS 3.2 and later.

Declared in MPMoviePlayerController.h.

引用MPMoviePlayerController

关于iphone - 隐藏电影播放器​​中的音量栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13153426/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com