求助~如何获得imageview的宽和高 当在xml中设置android:layout_width="fill_parent",android:layout_height="wrap_content"时,怎么在代码中得到图像的宽和高? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 getWidth()? getHeight()? 难道和普通的view不一样? 我的得到的是 0 不过在 view 的 onTouch 事件里面通过 getMeasuredHeight 可以获得正确的值public boolean onTouch(View v, MotionEvent event) { float heigth = v.getMeasuredHeight(); } 得到的是0? 在什么地方去get的呢? oncreate里? 是不是界面还没有显示的时候就去get的?那估计是会得不到大小的,因为系统layout还没有结束...等界面显示出来后再去get?onTouch事件里使用getWidth() 和 getHeight()也是0? 谢谢大家了,确实得等layout结束才可以 敢问亲们,都是在windows上做跑android吗 activity启动太慢会黑屏 新手求救:如何使用Android源码 不能编译 求Android外文pdf加翻译? android 单元测试 谁能详细说说 一个绘制飞机的方法 PDF417二维码开发 请问如何将onActivityResult得到的数据更新在alertdialog上 400多套安卓源码,Android +4高级编程第三版及源码,云盘下载 Android socket权限设置问题 求百度MP3地址解密 android 检测已经运行的程序
不过在 view 的 onTouch 事件里面通过 getMeasuredHeight 可以获得正确的值public boolean onTouch(View v, MotionEvent event) {
float heigth = v.getMeasuredHeight(); }
等界面显示出来后再去get?onTouch事件里使用getWidth() 和 getHeight()也是0?