- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
有没有办法自定义 MediaController?我需要更改按钮、SeekBar 等的样式。
最佳答案
您可以做的是递归 MediaController 的 View 层次结构并以编程方式设置 SeekBar 的可绘制对象:
private void styleMediaController(View view) {
if (view instanceof MediaController) {
MediaController v = (MediaController) view;
for(int i = 0; i < v.getChildCount(); i++) {
styleMediaController(v.getChildAt(i));
}
} else
if (view instanceof LinearLayout) {
LinearLayout ll = (LinearLayout) view;
for(int i = 0; i < ll.getChildCount(); i++) {
styleMediaController(ll.getChildAt(i));
}
} else if (view instanceof SeekBar) {
((SeekBar) view).setProgressDrawable(getResources().getDrawable(R.drawable.progressbar));
((SeekBar) view).setThumb(getResources().getDrawable(R.drawable.progresshandle));
}
}
然后,就打电话
styleMediaController(myMC);
关于android - 更改 android MediaController 的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2044000/
我想向 MediaController 添加一个按钮。所以我扩展了 MediaController 类,创建了一个按钮并将其添加到框架布局中。但是新添加的按钮在运行时没有反射(reflect)。 请找
在我阅读的有关 MediaController 小部件的 android 文档中 Functions like show() and hide() have no effect when MediaC
我正在为 VideoView 使用“android.widget.MediaController”。不确定何时使用“android.media.session.MediaController”以及它们
@Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(ha
我需要为我的播放器应用制作一个Controller。在它的帮助下,用户可以播放、暂停、选择下一首或上一首歌曲。但是这个 Controller 没有显示,我不知道为什么? 我已经完成了为 Control
我有一个 MediaController mc 和 VideoView videoView 链接如下: videoView.setMediaController(mc); 但是,我还想
我正在制作一个 MusicPlayer 应用程序来播放设备上可用的歌曲。我的问题是当我播放歌曲时 MediaController 没有显示。我已经尝试了所有可能的方法,但 MediaControlle
所以我有以下代码可以正常工作: VideoView videoView = (VideoView)findViewById(R.id.videoView1); videoView.setVideoPa
我正在将 MediaController 添加到 VideoView,但除非我点击手机,否则它不会显示。 Controller 在一段时间后消失。 有没有办法让 MediaController 始终显
我在我的 Activity 中使用了 MediaController 它工作正常但是当我第一次播放视频时应该有 b 暂停按钮可见但是有播放并且当我按下该按钮时视频正确暂停并且状态保持不变然后它正常工作
我的应用程序的上半部分有一个 VideoView,下面有一个 MediaController。下半部分是带有一些按钮的图像。当 MediaController 可见时,下面的按钮不可点击。这就像当 M
我目前正在 Android OS 2.3.3 上开发一个简单的视频播放器,我使用 VideoView 来显示电影并使用 MediaController 来控制视频. 我想在搜索栏上添加几个章节标记,想
我一直在为我的应用程序使用 mediaController。 默认情况下,媒体 Controller 显示在屏幕底部。 有没有办法在屏幕中间显示媒体 Controller ? 最佳答案 只有在视频大小
我知道如何控制返回按钮。我在 FrameLayout 中嵌入了一个 VideoView。我的问题是当视频弹出时,视频控件会出现几秒钟。在它们可见时点击后退按钮会隐藏视频控件。有没有办法忽略该功能并执行
尝试使用媒体 Controller 通过 url 播放音频文件 但是我收到错误: 09-11 10:28:23.970: E/MediaPlayer(912): Attempt to call get
我正在尝试使用 MediaController 并对其进行更改,使其不会在 3 秒后消失。我在相关问题中找到了这段代码,我正在使用它: mediaController = new MediaContr
如何以编程方式更改 MediaController 图标?我的意思是播放/暂停/前进和倒退。 你看我已经添加了全屏按钮,但不知道如何更改这三个按钮。 自定义 MediaController 类: pu
嘿,我正在尝试修复项目中的错误。他们创建了一个媒体 Controller 并将其 anchor View 设置为视频 View 。 但是当我播放视频时,mediacontroller 被绘制在整个屏幕
当我旋转我的设备时,视频控件无法正确调整大小。我在这里制作了一段视频:http://www.youtube.com/watch?v=FgRythmUo3A 有没有办法“重绘”控件? 我对我的 list
我有一种情况,我正在使用 standard VideoView 流式传输视频结合 MediaController object .就播放而言一切正常,但是 ProgressBars 的外观因为当视频加
我是一名优秀的程序员,十分优秀!