dialog没有全屏

项目中使用了视频,视频上下都是黑边,所以设置backgroundcolor为黑色,但是最上面有一点一直没有被填充上(黄色部分),写测试发现是视频所在的dialog没有全屏。

最早怀疑是最上面的状态栏的问题,看高度正好和状态栏的高度相同。

但无论如何设置backgroundcolordrawable,padding,margin,layoutparam都无法解决问题,而且输出查看也没问题。

只能采取减少法了,不断删除相应的代码并观察,看看删除到哪里才不出现这个问题。

在删除时,突然发现在有段代码有:

		// this.getWindow().setLayout(screenWidth, screenHeight);

		mButton.setVisibility(View.INVISIBLE);
	}

看上面被注释掉那一行,这段代码在设置了视频了dialog后又重新了window的layout,难道问题出在这里?注释掉果然解决掉了问题。

 

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /opt/wordpress/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048