Android在一个ImageView的叠加项目的最佳方法 [英] Android Best way to overlay an item in an ImageView

查看:784
本文介绍了Android在一个ImageView的叠加项目的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何叠加视图在一个ImageView的任何想法?
更具体地讲,我想酥料饼视图,当用户点击我的ImageView的某些区域。
我解决这个问题绘制酥料饼视图中的onDraw()方法后的图像,但它一直在处理事件时疼痛用户单击酥料饼。

Any ideas on how to overlay a View over an ImageView? More specifically I would like to popover view when the user clicks in certain regions of my ImageView. I'm solving this problem drawing the popover view after the image in the onDraw() method but it has been a pain to handle events when the user clicks in the popover.

在此先感谢

推荐答案

的FrameLayout 解决了这个问题。你可以把里面的两个孩子的的FrameLayout ,其中第一个孩子将是背景,第二个将是前景。让你的的ImageView 在后台,那么你可以将任何其他查看,这将覆盖的ImageView 。希望这有助于。

FrameLayout resolves this problem. You can place two children inside the FrameLayout, where the first child will be the background and the second will be the foreground. Let your ImageView be in background, then you can place any other View and it will overlay the ImageView. Hope this helps.

这篇关于Android在一个ImageView的叠加项目的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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