Fixed in 126.96.36.199.
So, this used to be a random occurrence and now it's happening a lot. It looks like the bug occurs when updating the
I'm fixing this by 1. also clearing the achievements in
viewDidAppear: so there's a high probability that no changes will occur in
viewDidDisappear: and 2. Moving things to a custom view that has a fixed height so there's only one axis which things can be off on. Without the first fix, things look correct once popping has finished but buttons are in the wrong spot during the animation.
This is an iOS bug which we're probably hitting due to the weird way we do things.
When there are no achievements, the right navigation item looks like this:
[Inbox (image)]-[Fixed-Space = 0]-[Achievements (image)]
When a rep change comes in (say +5), the following happens:
- A custom view is added to the achievements view as customView.
- If the width of that view is less than the width of the image (42pt), the difference is added to the the fixed space item so Inbox doesn't move.
[Inbox (image)]-[Fixed-Space = 5]-[Achievements (custom)]
This causes the achievements bar button to be further right than it was with the image. The fact that the +5 label is also shorter causes it to be lower than the image would be as well.
I suspect that under certain conditions when transitioning from the custom view to the image, the navigation bar isn't getting properly laid out, causing the image's origin to be down and to the right of where it should be.
Since I can't reliably reproduce this, and I'm hesitant to throw extra
setNeedsLayout calls onto a
UINavigationBar to try to blindly fix this, I'm just gonna leave it alone for now.