Situation. I have Widgets A, B and C nested in each other in that order
B is anchored to A flush with its sides. C is anchored to B, a percent of its size
Everything works correctly with my setup until I call this code
sprite.spriteName = newSpriteFrameName;
UISpriteData spriteData = sprite.atlas.GetSprite(newSpriteFrameName);
sprite.aspectRatio = (float)spriteData.width / (float)spriteData.height;
sprite.Update();
I have tried calling UpdateAndResetAnchors on B and C but it did not help. If I poke at the anchors while the thing is running, eventually it figures out what it was supposed to do. Thoughts?