是否有可能将一个ImageView的在扩展视图类? [英] Is it possible to place an imageView in a class that extends View?

查看:120
本文介绍了是否有可能将一个ImageView的在扩展视图类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能将一个ImageView的在扩展在android系统视图类?
如果可能的话,请给我一个样品code。
谢谢你。

Is it possible to place an imageView in a class that extends View in android? If possible please give me a sample code. Thanks.

推荐答案

如果你想创建一个包含的ImageView (和presumably一些其他的自定义视图项目),你可能只是想延长的ViewGroup ,如的 RelativeLayout的 而不是直接延长查看

If you want to create a custom view that contains an ImageView (and presumably some other items), you probably just want to extend a ViewGroup, such as a RelativeLayout rather than directly extending View.

请参阅的复合控件的部分自定义组件页面上的Andr​​oid开发者网站。

See the "Compound Controls" section of the Custom Components page on the Android Developers' site.

这篇关于是否有可能将一个ImageView的在扩展视图类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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