按钮中的播放图标

发布于 2025-01-07 11:11:04 字数 364 浏览 4 评论 0原文

如何在按钮中获得此播放箭头?如果您有一个嵌入 YouTube 视频的网站,则该箭头应该看起来像这样。

图片
(来源:iPhoneIncubator.com

How do I get this play arrow in a button? This arrow should look like if you have an website with an embed YouTube video.

Image
(source: iPhoneIncubator.com)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无力看清 2025-01-14 11:11:04

如果您要直接从应用程序播放 YouTube 内容,这里有一些有关如何放置 UIWebView 来显示 YouTube 内容的信息。查看方法#2,它演示了该缩略图的创建。

YouTube API 信息

对于其他视频源,您可以使用将按钮的背景颜色设置为视频的静止帧,

button.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"videoStill.png"]];

然后将按钮的图像属性设置为具有透明度的播放按钮。

[button setImage:[UIImage imageNamed:@"playButton.png"] forState:UIControlStateNormal];

If you're going to be playing YouTube content directly from the app there is some information on how to place a UIWebView to display the content from YouTube. Check out Method #2 which demonstrates the creation of this thumbnail.

YouTube API Information

For other video sources, you could set the background color of the button to be a still frame of the video using

button.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"videoStill.png"]];

Then set the button's image property to a play button with transparency.

[button setImage:[UIImage imageNamed:@"playButton.png"] forState:UIControlStateNormal];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文