当onSizeChanged()叫什么名字? [英] when is onSizeChanged() called?

查看:184
本文介绍了当onSizeChanged()叫什么名字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

onSizeChanged()称为一旦用户触摸屏幕的某些部分?

Is onSizeChanged() called once the user touches some part of the screen?

我感到困惑的顺序的OnDraw() onMeasure() onSizeChanged()被调用。

I'm confused about the order in which onDraw(), onMeasure() and onSizeChanged() are called.

推荐答案

Android不知道在启动时,它需要计算它的实际大小。一旦完成, onSizeChanged()将与实际尺寸通知你。

Android doesn't know the real size at start, it needs to calculate it. Once it's done, onSizeChanged() will notify you with the real size.

onSizeChanged()被调用一次的大小计算。事件没有来自用户所有的时间。在这个例子中,当Android的改变大小, onSizeChanged()被调用。同样的事情的OnDraw(),当认为应当制定的OnDraw()之称。

onSizeChanged() is called once the size as been calculated. Events don't have to come from users all the time. In this example when android change the size, onSizeChanged() is called. Same thing with onDraw(), when the view should be drawn onDraw() is called.

onMeasure()被调用措施()之后自动调用

这篇关于当onSizeChanged()叫什么名字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆