Android: How to get a custom View's height and width? [duplicate]
来源:互联网 发布:ajax传递表单数据 编辑:程序博客网 时间:2024/06/13 05:45
Sorry, this question was already asked. I found the answer here - How to size an Android view based on its parent's dimensions
@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int parentWidth = MeasureSpec.getSize(widthMeasureSpec); int parentHeight = MeasureSpec.getSize(heightMeasureSpec); this.setMeasuredDimension(parentWidth, parentHeight); super.onMeasure(widthMeasureSpec, heightMeasureSpec);}
http://stackoverflow.com/questions/4074937/android-how-to-get-a-custom-views-height-and-width
0 0
- Android: How to get a custom View's height and width? [duplicate]
- How to get width/height of a View
- Android get layout height and width in a fragment
- Android LruCache : how to put and get user's data
- How to send and handle a custom Windows message
- #431 – 绑定控件的宽度到高度(Binding a Control’s Width to Its Height)
- Android Dialog fullScreen&Custom The Width&Height of The Dialog
- Get “android:layout_height” from `AttributeSet` in a custom view constructor
- how to get UILable text width
- How to create a custom notification on Android
- How to change the ClearCase view's owner and group
- How to Run and View a Listener Trace
- android view的width或者height变化的动画
- android-获取View的Width和Height-随心
- How to: Create a Custom List Definition
- How to Write a Custom Swing Component
- How To Create a Custom Salesforce Communities Login and Landing Page
- how to get a polygon
- Swift自学_数据类型
- Android加密文件系统
- centos6.7 配置多个ip
- crontab命令---Linux学习笔记
- Hadoop分布式安装01
- Android: How to get a custom View's height and width? [duplicate]
- android ndk开发
- 深入理解JVM之六:类加载机制
- 人脸识别“DeepID”
- 关于 const
- JAVA Spring框架各版本官方下载地址和方法
- Android高效加载大图、多图解决方案,有效避免程序OOM
- easy_install和pip
- IONIC 自动更新APP版本