边框内的MediaElement

编程入门 行业动态 更新时间:2024-10-27 17:10:43
本文介绍了边框内的MediaElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个网格作为我的最外层元素,在其中一行中我有一个border元素,然后是一个media元素。媒体元素填充到网格行的大小。我需要设置什么来确保媒体元素保持在边框内? < Border Height =" Auto"宽度= QUOT;自动"余量= QUOT; 10,10,10,10"填充= QUOT; 5,5,5,5" Grid.Row = QUOT 1 QUOT; Grid.Column =" 0"> < Media /> < / Border>

I have a grid as my outermost element and in one of the rows I have a border element and then a media element. The media element fills to the size of the grid row. What do I need to set to ensure the media element stays inside the border?<Border Height="Auto" Width="Auto" Margin="10,10,10,10" Padding="5,5,5,5" Grid.Row="1" Grid.Column="0"><Media/></Border>

推荐答案

是您的媒体元素大于你的边界?如果您有明确设置的尺寸(例如720x480),并且您的边框要么小于该尺寸,要么折叠到小于该尺寸,那么您将遇到麻烦。 如果是这种情况,您可以将最小高度和最小宽度属性设置为边框,该属性等于媒体元素的大小+边框填充,或者您可以将媒体元素包装在滚动查看器中以包含它在边框大小内。 Is your media element bigger than your border? If you have an explicitly set size (say 720x480), and your border is either smaller than that size or can collapse to smaller than that size, you're going to be in trouble. If that's the case, you can either set min height and min width attributes to your border that are equal to the media element's size + the border padding, or you can wrap the media element in a scroll viewer to contain it within the border size.

更多推荐

边框内的MediaElement

本文发布于:2023-07-11 11:58:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   MediaElement

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!