zoukankan      html  css  js  c++  java
  • View设置宽高

     1 public class ViewMeasuare extends View {
     2 
     3     public ViewMeasuare(Context context, AttributeSet attrs) {
     4         super(context, attrs);
     5     }
     6     
     7     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
     8         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
     9         setMeasuredDimension(780, 120);
    10     }
    11     
    12 }
    setMeasuredDimension 这个方法的确把我实实在在的坑了一把
     
  • 相关阅读:
    Docker
    Docker
    VIM
    Python
    Python
    VIM
    Python
    其他
    Java
    Java
  • 原文地址:https://www.cnblogs.com/royi123/p/4213522.html
Copyright © 2011-2022 走看看