fixed issue 1241, resize is called properly on iOS