Now I want to add a white background border to the view, but when the view performs an animation, its width will dynamically scale, while the background does not scale along with it because the layout parameters of the view have not changed. Can a custom attribute be added to achieve the background addition function, or can the animation execution process be monitored and the width change of the view be exposed externally?

Now I want to add a white background border to the view, but when the view performs an animation, its width will dynamically scale, while the background does not scale along with it because the layout parameters of the view have not changed. Can a custom attribute be added to achieve the background addition function, or can the animation execution process be monitored and the width change of the view be exposed externally?