当onSizeChanged()叫什么名字?叫什么名字、onSizeChanged

2023-09-06 02:08:00 作者:三分温柔七分坚强

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()被调用措施()之后自动调用