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

做网站最好的公司网页设计软件有哪些

做网站最好的公司,网页设计软件有哪些,企业网站开发报告,wordpress 获取page别名系列文章目录 文章目录 一、 从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.shuangfujiaoyu.com/news/19295.html

相关文章:

  • 珠海软件公司排名下列关于seo优化说法不正确的是
  • 武汉网站托管公司关键词长尾词优化
  • 少儿培训河南整站关键词排名优化软件
  • 湖南网站建设360o哪有免费的网站
  • 淘宝联盟填网站备案如何分析百度指数
  • 网站mip怎么做惠州百度seo在哪
  • 网站建设项目的实训报告企业网络推广的方法
  • 做网站设计提成赚钱吗免费学生网页制作成品代码
  • 个人网站链接怎么做友情链接属于免费推广吗
  • 自己做书画交易网站公司培训课程有哪些
  • 包头做网站百度词条优化
  • 阿里网站年费怎么做分录设计培训班学费一般多少
  • 建设建行积分兑换商城网站搜索引擎营销的成功案例
  • 网站建设错误要点网络营销的概念及内容
  • 做建材批发的网站推广引流方法有哪些推广方法
  • 网站备案备注怎么写做小程序公司哪家好
  • 汉中网站制作百度总部电话
  • 濮阳做网站的公司美发培训职业学校
  • 有企业信息的网站百度搜索入口网址
  • 临沂做网站费用搜索词和关键词
  • 商丘做网站兰州seo整站优化服务商
  • 咨询网站 模板自己在家做电商
  • 网站可以做章子吗网络推广竞价
  • wordpress方法成都百度推广排名优化
  • 深圳网站制作公司深圳app开发百度搜索引擎收录
  • 怎么给自己的网站做扫描码零基础能做网络推广吗
  • 深圳做手机网站建设惠州seo报价
  • 惠州城乡规划建设局网站外贸商城建站
  • 工程建设领域专项治理工作网站国际新闻最新消息十条摘抄
  • 提供网站建设收益分录简阳seo排名优化培训