onMeasure(int widthMeasureSpec, int heightMeasureSpec)参数
来源:互联网 发布:润和软件简介 编辑:程序博客网 时间:2024/05/07 15:51
自己继承ViewGroup实现一个视图。重写protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
发现执行该函数时widthMeasureSpec值为1073742304,heightMeasureSpec值为-2147482923。
这两个值是什么意思?
已解决:
Log.d("ANDROID_LAB",
" w_mode=" + MeasureSpec.getMode(widthMeasureSpec) +
" h_mode=" + MeasureSpec.getMode(heightMeasureSpec)+
" w_size="+ MeasureSpec.getSize(widthMeasureSpec) +
" h_size=" + MeasureSpec.getSize(heightMeasureSpec));
其中getMode()返回值为:EXACTLY。
得到的两个值其实就是窗口的大小+MeasureSpec类中的specMode的值
- onMeasure(int widthMeasureSpec, int heightMeasureSpec)参数
- onMeasure(int widthMeasureSpec, int heightMeasureSpec)
- View onMeasure (int widthMeasureSpec, int heightMeasureSpec)
- View onMeasure(int widthMeasureSpec, int heightMeasureSpec)
- 自定义View之onMeasure(int widthMeasureSpec, int heightMeasureSpec)方法解释
- android 控件中layout_width,layout_height与onMeasure(int widthMeasureSpec, int heightMeasureSpec)
- 解决滑动冲突和自定义控件中对onMeasure(int widthMeasureSpec, int heightMeasureSpec)方法的理解
- 为什么要重写View的onMeasure(int widthMeasureSpec, int heightMeasureSpec)方法
- 自定义View,关于onMeasure方法的两个参数widthMeasureSpec,heightMeasureSpec
- measure(widthMeasureSpec,heightMeasureSpec);
- measure(widthMeasureSpec, heightMeasureSpec)的使用技巧
- Android layout(int ,int,int,int)四个参数含义
- int socket(int domain, int type, int protocol)参数详解
- 自定义View---widthMeasureSpec和heightMeasureSpec是从哪来?
- int
- int?
- int ?
- int
- PhoneGap入门经典——理解PhoneGap应用程序基础
- Java多线程编程环境中单例模式的实现
- android getevent/setevent
- mtk android lcm 打印log信息方法
- linux下qt环境搭建
- onMeasure(int widthMeasureSpec, int heightMeasureSpec)参数
- Linux后台执行命令
- 修改UIWebview的字体大小
- Ext 表单提交
- cmnet与cmwap区别
- XCode 显示代码开发行数
- arcgis 标注按字数个数换行 FindLabel
- valgrind massif
- 常用正则表达式