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

自己做网站服务器网络营销推广的优势

自己做网站服务器,网络营销推广的优势,策划方案免费的网站,wordpress rest图片系列文章目录 文章目录 一、 从0开始实现 onCreate 的setContentView二、 从0 开始实现 onMeasure三、 从0 开始实现 onLayout四、 从0 开始实现 onDraw总结 前言 接上文,测量完View树的每个节点View的宽和高后,开始布局。 一、ViewRootImpl 的调用栈…

系列文章目录

文章目录
  • 一、 从0开始实现 onCreate 的setContentView
  • 二、 从0 开始实现 onMeasure
  • 三、 从0 开始实现 onLayout
  • 四、 从0 开始实现 onDraw
  • 总结

前言

接上文,测量完View树的每个节点View的宽和高后,开始布局。

一、ViewRootImpl 的调用栈

ViewRootImpl->performLayout(lp, mWidth, mHeight);

                        host.layout()

ViewGroup -> layout(int l, int t, int r, int b)

View -> layout(int l, int t, int r, int b)

View ->setFrame(l, t, r, b)

           onLayout(changed, l, t, r, b)

DecorView-> onLayout(changed, l, t, r, b)

FrameLayout->onLayout()

                        layoutChildren()

二、布局每个View

View.java  layout() 函数先设置自己的 left, right, top, bottom ,再做onLayout动作, onLayout的意图是布局 子控件。 view 已经没有子控件了, 所以 view的onLayout 什么也不做。

protected int mLeft;protected int mRight;protected int mTop;protected int mBottom;public void layout(int l, int t, int r, int b) {boolean changed = isLayoutModeOptical(mParent) ?setOpticalFrame(l, t, r, b) : setFrame(l, t, r, b);if (changed || (mPrivateFlags & PFLAG_LAYOUT_REQUIRED) == PFLAG_LAYOUT_REQUIRED) {onLayout(changed, l, t, r, b);
}}protected boolean setFrame(int left, int top, int right, int bottom) {...mLeft = left;mTop = top;mRight = right;mBottom = bottom;...
}protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
}

由于 ViewGroup 的 onLayout 是虚函数, 所以 ViewGroup 需要实现自己的onLayout

   public final void layout(int l, int t, int r, int b) {if (!mSuppressLayout && (mTransition == null || !mTransition.isChangingLayout())) {if (mTransition != null) {mTransition.layoutChange(this);}super.layout(l, t, r, b);} else {// record the fact that we noop'd it; request layout when transition finishesmLayoutCalledWhileSuppressed = true;}
}protected abstract void onLayout(boolean changed,int l, int t, int r, int b);

总结:

View 树的布局实际是给 每个view子节点的 mLeft, mTop, mRight, mBottom 四个成员变量赋值, 这四个成员变量代表 了 view 这个矩形框的位置和大小。

http://www.15wanjia.com/news/56532.html

相关文章:

  • 网站如何做关键字收录技能培训机构
  • 怎样做网站和网站的友情链接技能培训
  • 网站开发哪家公司比较好千部小黄油资源百度云
  • 香港公司做网站国外销售太原seo外包公司
  • 专业做网站联系方式百度推广登录账号首页
  • 鲁中网淄博市疫情西安seo代运营
  • 朝阳做网站google下载官方版
  • 怎样推广产品河南网站排名优化
  • 搭建写真网站赚钱项目百度指数使用指南
  • 商城网站做推广方案a站
  • 乌鲁木齐最新消息通知搜索优化的培训免费咨询
  • 如何找到app的开发者石家庄百度搜索引擎优化
  • 网站设计二级页面怎么做升华网络推广软件
  • 钓鱼网站到底怎么做广东vs北京首钢
  • 网站建设元play商店
  • 关键词做网站标题是什么意思东莞seo推广
  • 深圳市在建项目查询seo快速排名软件价格
  • wordpress 商品页规格西安网站建设方案优化
  • 男人做想看的免费网站西安做seo的公司
  • 网站建设多少钱裙企业网站建设目标
  • 成都官方网站建设网页设计收费标准
  • 江苏省建设工程竣工验收网站网络网站推广
  • 有了阿里云服务器怎么做网站百度站长
  • wordpress安全部署西安seo优化顾问
  • 建设工程规范发布网站厦门百度推广排名优化
  • 网站建设 论坛网站排名点击工具
  • 网站怎么做qq微信登陆界面设计营销技巧第三季
  • 电商购物网站建设平台推广广告宣传词
  • 乌海做网站的公司徐州新站百度快照优化
  • 北京单页营销型网站制作谷歌流量代理代理