作家
登录

Android View绘制的三大流程

作者: 来源: 2017-08-22 11:05:27 阅读 我要评论

 padding, int childDimension) {   
  •     int specMode = MeasureSpec.getMode(spec); 
  •     int specSize = MeasureSpec.getSize(spec); 
  •  
  •     int size = Math.max(0, specSize - padding); 
  •  
  •     int resultSize = 0; 
  •     int resultMode = 0; 
  •  
  •     switch (specMode) { 
  •     // Parent has imposed an exact size on us 
  •     case MeasureSpec.EXACTLY: 
  •         if (childDimension >= 0) { 
  •             resultSize = childDimension; 
  •             resultMode = MeasureSpec.EXACTLY; 
  •         } else if (childDimension == LayoutParams.MATCH_PARENT) { 
  •             // Child wants to be our size. So be it. 
  •             resultSize = size
  •             resultMode = MeasureSpec.EXACTLY; 
  •         } else if (childDimension == LayoutParams.WRAP_CONTENT) { 
  •             // Child wants to determine its own size. It can't be 
  •             // bigger than us. 
  •             resultSize = size
  •             resultMode = MeasureSpec.AT_MOST; 
  •         } 
  •         break; 
  •  
  •     // Parent has imposed a maximum size on us 
  •     case MeasureSpec.AT_MOST: 
  •         if (childDimension >= 0) { 
  •             // Child wants a specific size... so be it 
  •             resultSize = childDimension; 
  •             resultMode = MeasureSpec.EXACTLY; 

      推荐阅读

      两种曲线点抽稀算法-Python实现 附代码

    在处理矢量化数据时,记录中往往话苄很多反复数据,对进一步数据处理带来诸多不便。多余的数据一方面浪费了较多的存储空间,另一方面造成所要表达的图形不但滑或不相符标准。是以要经由过程某种规矩,在包管矢量曲线>>>详细阅读


    本文标题:Android View绘制的三大流程

    地址:http://www.17bianji.com/lsqh/36843.html

  • 关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)