在SurfaceView中显示ImageView
我目前正在尝试为 SurfaceView 中的一些图像添加动画效果。现在,我将图像显示为位图。但是,我认为将这些位图实现为 ImageView 可能会更好。我无法在 SurfaceView 上创建多个 ImageView(我试图不在 XML 中执行此操作,因为我希望首先让事情正常工作,然后再进行更改,以便它更便携)。有没有关于如何执行此操作的教程,或者我喜欢 wayyy,应该只使用位图?
I am currently attempting to animate some images in my SurfaceView. Right now, I am displaying my images as Bitmaps. However, I think it might be better to implement these Bitmaps as ImageViews. I have not been able to create multiple ImageViews on my SurfaceView (I am trying to not do this in XML, as I want to get things working first and then later change things around so it is more portable). Is there a tutorial somewhere on how to do this, or am I like wayyy off and should just stick to Bitmaps??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,您不应尝试混合使用
View
对象和SurfaceView
。 SurfaceView 是一个非常特殊的视图,它通过在当前窗口中打孔来提供直接绘图。坚持使用位图似乎更好。You generally shouldn't try to mix
View
objects andSurfaceView
.SurfaceView
is a very special view that provides direct drawing by essentially punching a hole in the current window. It seems better to stick to bitmaps.