安卓:图像在图像 [英] Android: Image over image

查看:103
本文介绍了安卓:图像在图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视频缩略图,当你点击它,在视频开始在YouTube播放器播放。这个伟大的工程,但它不是那么清楚,你必须点击缩略图玩,所以我有我想提请多年来在右下角的缩略图播放按钮图像。我怎么会去吗?我现在有缩略图中的可绘制对象,并在我的绘制资源目录中的播放按钮。我想的东西用位图和帆布,但它会很困难,我不知道这是不是要走的路。

I have a video thumbnail and when you click on it, the video starts playing in the YouTube player. This works great, but It's not so clear that you have to click on the thumbnail to play, so I have a play button image that I want to draw over the thumbnail in the bottom right corner. How would I go about this? I currently have the thumbnail in a Drawable object and the play button in my drawable resource directory. I tried stuff with bitmaps and canvas but it's quite hard and I don't know if this is the way to go.

非常感谢! 埃里克

推荐答案

使用相对或的FrameLayout:

Use Relative or FrameLayout:

<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
    <ImageView  android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/thumbnail"/>
    <ImageView  android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/play" android:layout_alignParentBottom="true" android:layout_alignParentRight="true"/>
</RelativeLayout>

<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
    <ImageView  android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/thumbnail"/>
    <ImageView  android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/play" android:layout_gravity="bottom|right"/>
</FrameLayout>

这篇关于安卓:图像在图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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