<legend id='hH0Uv'><style id='hH0Uv'><dir id='hH0Uv'><q id='hH0Uv'></q></dir></style></legend>

<small id='hH0Uv'></small><noframes id='hH0Uv'>

        <bdo id='hH0Uv'></bdo><ul id='hH0Uv'></ul>

      <i id='hH0Uv'><tr id='hH0Uv'><dt id='hH0Uv'><q id='hH0Uv'><span id='hH0Uv'><b id='hH0Uv'><form id='hH0Uv'><ins id='hH0Uv'></ins><ul id='hH0Uv'></ul><sub id='hH0Uv'></sub></form><legend id='hH0Uv'></legend><bdo id='hH0Uv'><pre id='hH0Uv'><center id='hH0Uv'></center></pre></bdo></b><th id='hH0Uv'></th></span></q></dt></tr></i><div id='hH0Uv'><tfoot id='hH0Uv'></tfoot><dl id='hH0Uv'><fieldset id='hH0Uv'></fieldset></dl></div>
        <tfoot id='hH0Uv'></tfoot>

        Android VideoView:对话框视图中的视频视图要暗得多

        时间:2023-08-30
        <tfoot id='jIkgW'></tfoot>
        <i id='jIkgW'><tr id='jIkgW'><dt id='jIkgW'><q id='jIkgW'><span id='jIkgW'><b id='jIkgW'><form id='jIkgW'><ins id='jIkgW'></ins><ul id='jIkgW'></ul><sub id='jIkgW'></sub></form><legend id='jIkgW'></legend><bdo id='jIkgW'><pre id='jIkgW'><center id='jIkgW'></center></pre></bdo></b><th id='jIkgW'></th></span></q></dt></tr></i><div id='jIkgW'><tfoot id='jIkgW'></tfoot><dl id='jIkgW'><fieldset id='jIkgW'></fieldset></dl></div>

          <bdo id='jIkgW'></bdo><ul id='jIkgW'></ul>
          • <legend id='jIkgW'><style id='jIkgW'><dir id='jIkgW'><q id='jIkgW'></q></dir></style></legend>
          • <small id='jIkgW'></small><noframes id='jIkgW'>

                  <tbody id='jIkgW'></tbody>
                1. 本文介绍了Android VideoView:对话框视图中的视频视图要暗得多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  大家好我在对话框视图中嵌入视频视图时遇到问题

                  Hi all I have a problem with embedding a video view inside a dialog view

                  一切正常,只是对话框中显示的视频比在活动的其余部分中显示的要暗得多

                  everything works fine except that the video displayed in the Dialog is much darker that if displayed in the rest of the activity

                  有什么想法吗?

                  这里有一些代码

                  button1main.setOnClickListener(new OnClickListener() {
                  
                                  public VideoView videoView = null;
                                  @Override
                                  public void onClick(View v) {
                                      //set up dialog
                                      Dialog dialog = new Dialog(CustomDialog.this);
                                      dialog.setContentView(R.layout.maindialog);
                                      //dialog.setTitle("This is my custom dialog box");
                                      dialog.setCancelable(true);
                  
                  
                                      this.videoView = (VideoView) dialog.findViewById(R.id.video);
                                      VideoPlayer vp = new VideoPlayer(this.videoView, null);
                                      vp.playVideo();
                  
                                      //set up button
                                      Button button = (Button) dialog.findViewById(R.id.Button01);
                                      button.setOnClickListener(new OnClickListener() {
                                      @Override
                                          public void onClick(View v) {
                                              finish();
                                          }
                                      });
                                      //now that the dialog is set up, it's time to show it    
                                      dialog.show();
                                  }
                              });
                  

                  推荐答案

                  我实际上找到了解决方案(或者至少在我的情况下)

                  I actually found the solution to this (or at least in my case)

                  这似乎是 android 的一个错误,其中视频视图是在对话框后面创建的,当对话框打开时,它会使包括视频在内的背景视图变暗

                  it seems its a bug from android where the Video View is created behind the Dialog and when the Dialog opens it dims the background views including the video

                  我应用的快速修复"是

                  WindowManager.LayoutParams a = dialog.getWindow().getAttributes();
                  a.dimAmount = 0;
                  dialog.getWindow().setAttributes(a);
                  

                  它们可能是一个更好的解决方案,例如传递对话框的上下文,而不是使用相同的上下文来创建对话框和视频视图(如果有时间我会稍后检查)

                  they might be a solution better solution like passing the context of the Dialog box instead of using the same context for creating the Dialog and the Video View (I'll check later if I get sone time)

                  这篇关于Android VideoView:对话框视图中的视频视图要暗得多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Dialog.show() 与 Activity.showDialog() 下一篇:在 Android 中创建自定义对话框

                  相关文章

                  最新文章

                  • <bdo id='Zi07o'></bdo><ul id='Zi07o'></ul>

                  1. <i id='Zi07o'><tr id='Zi07o'><dt id='Zi07o'><q id='Zi07o'><span id='Zi07o'><b id='Zi07o'><form id='Zi07o'><ins id='Zi07o'></ins><ul id='Zi07o'></ul><sub id='Zi07o'></sub></form><legend id='Zi07o'></legend><bdo id='Zi07o'><pre id='Zi07o'><center id='Zi07o'></center></pre></bdo></b><th id='Zi07o'></th></span></q></dt></tr></i><div id='Zi07o'><tfoot id='Zi07o'></tfoot><dl id='Zi07o'><fieldset id='Zi07o'></fieldset></dl></div>
                    <legend id='Zi07o'><style id='Zi07o'><dir id='Zi07o'><q id='Zi07o'></q></dir></style></legend>
                    <tfoot id='Zi07o'></tfoot>

                    <small id='Zi07o'></small><noframes id='Zi07o'>