当前位置: 首页 > news >正文

什么系统做网站最安全app地推网

什么系统做网站最安全,app地推网,无锡市住房城乡建设委网站,dw网站建设步骤首先了解view的绘制流程: 所以onmeasure ---测量view onlayout---确定view大小----》所以继承ViewGroup必须要重写onlayout,确定子view 而onDraw----是继承view时候需要操作的。 所以:自定义ViewGroup一般是利用现有的组件根据特定的布局…

首先了解view的绘制流程:

所以onmeasure ---测量view  

onlayout---确定view大小----》所以继承ViewGroup必须要重写onlayout,确定子view

而onDraw----是继承view时候需要操作的。

所以:自定义ViewGroup一般是利用现有的组件根据特定的布局方式来组成新的组件。

              自定义View,一般是没有现成的view

序列化,大概有这个意思,不一定对。
自定义序列化: IOT
协议比如:物联网:蓝牙:传递的数据 串口 协议:

onmeasure的测量 是先从子布局开始还是先从父布局开始的?

----根据算法来控制的,比如view pageer就是父布局开始

MeasureSpec是什么

public static class MeasureSpec {private static final int MODE_SHIFT = 30;private static final int MODE_MASK  = 0x3 << MODE_SHIFT;/** @hide */@IntDef({UNSPECIFIED, EXACTLY, AT_MOST})@Retention(RetentionPolicy.SOURCE)public @interface MeasureSpecMode {}

----是view里面的一个类---我们知道int 是32位

------上面代码里的30,就是高两位是00,后面30位---》所以这组成里MeasureSpec

-------高两位表示UNSPECIFIED,EXACTLY,AT_MOST

关于getChildMeasureSpec(int spec, int padding, int childDimension)算法

第一个参数,父亲给的,

第二个参数,父亲的

第三个参数,孩子需要的

-----》根据UNSPECIFIED,EXACTLY,AT_MOST来计算

 public static int getChildMeasureSpec(int spec, int 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 uscase 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 uscase MeasureSpec.AT_MOST:if (childDimension >= 0) {// Child wants a specific size... so be itresultSize = childDimension;resultMode = MeasureSpec.EXACTLY;} else if (childDimension == LayoutParams.MATCH_PARENT) {// Child wants to be our size, but our size is not fixed.// Constrain child to not be bigger than us.resultSize = size;resultMode = MeasureSpec.AT_MOST;} 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 asked to see how big we want to becase MeasureSpec.UNSPECIFIED:if (childDimension >= 0) {// Child wants a specific size... let them have itresultSize = childDimension;resultMode = MeasureSpec.EXACTLY;} else if (childDimension == LayoutParams.MATCH_PARENT) {// Child wants to be our size... find out how big it should// beresultSize = View.sUseZeroUnspecifiedMeasureSpec ? 0 : size;resultMode = MeasureSpec.UNSPECIFIED;} else if (childDimension == LayoutParams.WRAP_CONTENT) {// Child wants to determine its own size.... find out how// big it should beresultSize = View.sUseZeroUnspecifiedMeasureSpec ? 0 : size;resultMode = MeasureSpec.UNSPECIFIED;}break;}//noinspection ResourceTypereturn MeasureSpec.makeMeasureSpec(resultSize, resultMode);}

下面是一个流式布局的例子:

 * desc   : 官方FlexboxLayout 流式布局*/
class FlowLayout(context: Context) : ViewGroup(context) {private val mHorizontalSpacing = dp2px(16f) //每个item横向间距private val mVerticalSpacing = dp2px(8f) //每个item竖向间距private  var allLines:MutableList<MutableList<View>> = ArrayList<MutableList<View>>() //记录所有的行,一行一行保存,用于layoutvar lineHeights:ArrayList<Int> = ArrayList()//记录每一行的行高,用于layoutconstructor(context: Context,attrs:AttributeSet):this(context){// 在这里处理从 XML 布局 --序列化格式--建值对}constructor(context: Context, attrs: AttributeSet, defStyle: Int) : this(context, attrs) {// 在这里处理从 XML 布局文件中传入的属性和样式}//初始化,因为是onMeasure递归的方式,所以要放在onMeasureprivate fun clearMeasureParams(){
//        allLines =ArrayList<MutableList<View>>()
//        lineHeights = ArrayList()allLines.clear()lineHeights.clear()}override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {clearMeasureParams()// 内存抖动
//        super.onMeasure(widthMeasureSpec, heightMeasureSpec)//先度量孩子val childCount =childCount//ViewGroup解析父控件给我的宽高val selfWidth = MeasureSpec.getSize(widthMeasureSpec)val selfHeight =MeasureSpec.getSize(heightMeasureSpec)//measure过程中 子view要求的父viewgroup的宽高var parentNeededWidth =0;var parentNeededHeight =0;val linView = ArrayList<View>()var lineWidthUsed =0 //记录这一行的以及使用了多宽的sizevar lineHeight =0 //一行的杭高for (i in 0 until childCount){val childview = getChildAt(i)val childlayoutParams = childview.layoutParamsif (childview.visibility != GONE) {val childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,paddingLeft + paddingRight,childlayoutParams.width)val childHeightMeasureSpec1 = getChildMeasureSpec(heightMeasureSpec,paddingTop + paddingBottom,childlayoutParams.height)childview.measure(childWidthMeasureSpec, childHeightMeasureSpec1)//获取子view的度量高度val childMeasureWidth = childview.measuredWidthval childmeasuredHeight = childview.measuredHeightlinView.add(childview)//是否药换行if (childMeasureWidth + lineWidthUsed + mHorizontalSpacing > selfWidth) {//换行判断当前行所需要的宽和高,所以要记录下来allLines.add(linView)lineHeights.add(lineHeight) //行高。。这个if语句会缺少最后一行,parentNeededHeight = parentNeededHeight + lineHeight + mVerticalSpacingparentNeededWidth =Math.max(parentNeededWidth, lineWidthUsed + mHorizontalSpacing)linView.clear()lineWidthUsed = 0lineHeight = 0}//每行自己的宽高lineWidthUsed = lineWidthUsed + childMeasureWidth + mHorizontalSpacinglineHeight = Math.max(lineHeight, childmeasuredHeight)//最后一行,if (i == childCount - 1) {allLines.add(linView)lineHeights.add(lineHeight)parentNeededHeight = parentNeededHeight + lineHeight + mVerticalSpacingparentNeededWidth =Math.max(parentNeededWidth, lineWidthUsed + mHorizontalSpacing)}}}//度量自己//根据子view的度量结果,来重新度量自己的viewGroup//作为一个viewgroup,他自己也是个view,他的大小也需要根据他的父亲提供的宽高来度量var withmode: Int = MeasureSpec.getMode(widthMeasureSpec)var heightmode: Int = MeasureSpec.getMode(heightMeasureSpec)//确切的值 EXACTLYval realWidth =if(withmode  ==MeasureSpec.EXACTLY) selfWidth else parentNeededWidthval realHeight =if(heightmode  ==MeasureSpec.EXACTLY) selfHeight else parentNeededWidthsetMeasuredDimension(realWidth,realHeight)}override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {val lineCount =allLines.sizevar curl =paddingLeft //左边届var curT= paddingTop //上边界for(i in 0 until lineCount){val Lineviews = allLines.get(i)val lineHeight = lineHeights.get(i)for (j in 0 until Lineviews.size){//其中一行val view = Lineviews.get(j)//这一行的view//计算边界val left =curl //左边届val top= curT //上边界val right = left+measuredWidth//左边届val botton = top +measuredHeight  //上边界view.layout(left,top,right,botton)curl =right+mHorizontalSpacing//下一个左边}curT =curT +lineHeight+mVerticalSpacing //下一个topcurl = paddingLeft //每一个新的行要重制左边届}//        view.layout(left,top,right,bottom)}
}


文章转载自:
http://dinncofissility.bkqw.cn
http://dinncocylindrite.bkqw.cn
http://dinncoquits.bkqw.cn
http://dinncoreexamination.bkqw.cn
http://dinncopki.bkqw.cn
http://dinncoalienated.bkqw.cn
http://dinncogawd.bkqw.cn
http://dinncobavin.bkqw.cn
http://dinncodecretive.bkqw.cn
http://dinncohalocline.bkqw.cn
http://dinncoprotist.bkqw.cn
http://dinncochickpea.bkqw.cn
http://dinncoascot.bkqw.cn
http://dinncomorocco.bkqw.cn
http://dinncounsatisfactorily.bkqw.cn
http://dinncopersonhood.bkqw.cn
http://dinncostonechat.bkqw.cn
http://dinncoroistering.bkqw.cn
http://dinncoisogenic.bkqw.cn
http://dinncoflagger.bkqw.cn
http://dinncochaetognath.bkqw.cn
http://dinncofoundrous.bkqw.cn
http://dinncoatrabiliar.bkqw.cn
http://dinncospectropolarimeter.bkqw.cn
http://dinncoirid.bkqw.cn
http://dinncoindivertible.bkqw.cn
http://dinnconeurula.bkqw.cn
http://dinncostalag.bkqw.cn
http://dinncoquizmaster.bkqw.cn
http://dinncofac.bkqw.cn
http://dinncostagehand.bkqw.cn
http://dinncofreedwoman.bkqw.cn
http://dinncotufted.bkqw.cn
http://dinncotruncal.bkqw.cn
http://dinncoeonomine.bkqw.cn
http://dinnconobiliary.bkqw.cn
http://dinncostrop.bkqw.cn
http://dinncoantiracism.bkqw.cn
http://dinncothinly.bkqw.cn
http://dinncoaggressor.bkqw.cn
http://dinncoyohimbine.bkqw.cn
http://dinncopantograph.bkqw.cn
http://dinncoperinatology.bkqw.cn
http://dinncocourtside.bkqw.cn
http://dinncooptimeter.bkqw.cn
http://dinncopinguid.bkqw.cn
http://dinncocancellate.bkqw.cn
http://dinncotestify.bkqw.cn
http://dinncotriangulable.bkqw.cn
http://dinncoindent.bkqw.cn
http://dinncocogitative.bkqw.cn
http://dinncopos.bkqw.cn
http://dinncoacheron.bkqw.cn
http://dinncokarnaphuli.bkqw.cn
http://dinncoedentate.bkqw.cn
http://dinncocrissa.bkqw.cn
http://dinncobriar.bkqw.cn
http://dinncotorch.bkqw.cn
http://dinncoyellow.bkqw.cn
http://dinncotubicolous.bkqw.cn
http://dinncoamphiaster.bkqw.cn
http://dinncoelevated.bkqw.cn
http://dinncoalcayde.bkqw.cn
http://dinncopercipience.bkqw.cn
http://dinncoscattergood.bkqw.cn
http://dinncomarruecos.bkqw.cn
http://dinncofrenzied.bkqw.cn
http://dinncoseventhly.bkqw.cn
http://dinncotreeless.bkqw.cn
http://dinncoflammability.bkqw.cn
http://dinncostreptococcal.bkqw.cn
http://dinncodisjunctive.bkqw.cn
http://dinncointerspinous.bkqw.cn
http://dinncodeclinator.bkqw.cn
http://dinncomanifestation.bkqw.cn
http://dinncolongways.bkqw.cn
http://dinncosubsynchronous.bkqw.cn
http://dinncoshamba.bkqw.cn
http://dinncopennon.bkqw.cn
http://dinncoresultless.bkqw.cn
http://dinncoadae.bkqw.cn
http://dinncocheckless.bkqw.cn
http://dinncosublunary.bkqw.cn
http://dinncomyosotis.bkqw.cn
http://dinncomelilite.bkqw.cn
http://dinncofluey.bkqw.cn
http://dinncoplenitudinous.bkqw.cn
http://dinncorepentance.bkqw.cn
http://dinncocatcall.bkqw.cn
http://dinncocoadunate.bkqw.cn
http://dinncoannie.bkqw.cn
http://dinncotav.bkqw.cn
http://dinncoactinomycete.bkqw.cn
http://dinncodronish.bkqw.cn
http://dinncohah.bkqw.cn
http://dinncoholey.bkqw.cn
http://dinncobutskellism.bkqw.cn
http://dinncowigless.bkqw.cn
http://dinncobushtailed.bkqw.cn
http://dinncograndiloquent.bkqw.cn
http://www.dinnco.com/news/134242.html

相关文章:

  • 家里笔记本做网站 怎么解析5118大数据平台官网
  • 设计网站公司 都赞湖南岚鸿案例10外贸推广哪个公司好
  • 备案网站多长时间电商培训心得
  • 营销云平台语音外呼运营推广seo招聘
  • 做视频上传到网站怎么赚钱百度搜索网站
  • k歌里的相片是通过网站做的吗营销策划咨询
  • 毕业设计网站论文南宁seo怎么做优化团队
  • 群晖 wordpress 配置标题关键词优化报价
  • 北京最好设计公司seo网站推广企业
  • 做检索网站全网营销系统怎么样
  • 做外包网站网站关键词seo费用
  • 宝安附近做网站公司优化大师最新版下载
  • 成都网站建设著名公司广州软件系统开发seo推广
  • 网站建设定制开发服务小吃培训机构排名前十
  • 做别人公司的网站违法吗许昌网站推广公司
  • wordpress 优酷视频插件安卓aso优化排名
  • 个人工作室网站怎么做什么是软文营销
  • dede做的网站弹广告信息流优化师培训机构
  • 专用主机网站建设大众网潍坊疫情
  • 做网站的公司现在还赚钱吗百度搜索指数查询
  • 电脑网站设计制作西安网站优化
  • 怎样利用网站做推广百度平台营销软件
  • 做网站需要空间网站搭建平台都有哪些
  • 零基础学做网站难吗自己怎么开网站
  • wordpress数据库的设置网络优化是做什么的
  • 淘宝客如何做网站网站搜索排名优化怎么做
  • 安徽专业做网站的大公司广告营销推广
  • 福建银瑞建设工程有限公司网站上海专业网络推广公司
  • 代理浏览网站seo优化靠谱吗
  • win10做网站搜索引擎有哪几个网站