0

タブバーのタブをリロードしてから、正しいタブを選択するのに問題があります。

When a user chooses a particular function in my app - this means I need to reload the tab bar at the bottom of the screen - and sometimes add buttons and other times remove.

I am able to reload the data using:

[self.tabBarController setViewControllers:controllers animated:YES];

but I can't get the selectedViewIndex to work propery it just seems to get ignored:

self.tabBarController.selectedIndex = [controllers count]-1;

I want to have the last tab selected - but after this code has run it is always the first tab that is selected - Any ideas?

4

1 に答える 1

1

を発行することで、これを行う方法を見つけました。

[self.tabBarController.view setNeedsDisplay];

selectedIndex の呼び出し後 - しかし、問題は画面が点滅し、アニメーションがあまり良くないことです - 他のアイデアはありますか?

于 2009-06-25T13:25:29.703 に答える