问题描述
我正在使用 iOS YouTube 播放器助手 (https://developers.google.com/youtube/v3/guides/ios_youtube_helper),它工作得很好,但预览图像不是我视图的大小,我不知道如何更改它以使其适合我的 UIView创建.我怎样才能让它填满视图?
I am using the iOS YouTube Player helper (https://developers.google.com/youtube/v3/guides/ios_youtube_helper) and it works just fine but the preview image is not the size of my view and I can't figure out how to change it so it fits within the UIView I've created. How can I make it fill the view?
这是它的样子.
推荐答案
这为我解决了:
在Assets文件夹中应该有一个名为YTPlayerView-iframe-player.html"的html文件
In the Assets folder there should be an html file named "YTPlayerView-iframe-player.html"
替换style"标签之间的现有代码,如下所示,这将确保播放器填充 YTPlayerView 的 100%:
Replace the existing code between "style" tags as shown below and this will make sure the Player fills 100% of the YTPlayerView:
<style>
body { margin: 0; width:100%%; height:100%%; }
html { width:100%%; height:100%%; }
</style>
希望这会有所帮助!周末愉快!
Hope this helps a bit! Have a great weekend!
这篇关于YTPlayer 的视图大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!