全屏时在 MediaElement 上显示 TextBlock [英] Display a TextBlock over a MediaElement when in full screen

查看:27
本文介绍了全屏时在 MediaElement 上显示 TextBlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我旁边有一个 MediaElement 和一个 TextBlock.但是当我将 MediaElement 设置为全屏时,这个 TextBlock 消失了.任何人都可以分享解决方案吗?

I have a MediaElement and a TextBlock next to it. But when I set MediaElement to fullscreen, this TextBlock disappears. Can anyone share a solution?

<MediaElement Name="player" Margin="10,5" AreTransportControlsEnabled="True" />
<TextBlock Margin="10"/>

推荐答案

正如我在 这个线程,当我们处于Full Window模式时,它会和MediaTransportControls一起进入FullWindowMediaRoot层.这样 TextBlock 就会消失,因为没有地方可以显示 TextBlock.为了让 TextBlock 显示,我建议您参考 本文为 MediaEelement 创建自定义传输控件.

As I have said in this thread, when we are in the Full Window mode, it will go to the FullWindowMediaRoot layer with the MediaTransportControls. In this way the TextBlock will disapper, because there is no place to show the TextBlock. In order to let the TextBlock show, I will recommend you refer to this article to create a custom transport controls for the MediaEelement.

这篇关于全屏时在 MediaElement 上显示 TextBlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆