开发者

I Can't See the Highlighted State of My Custom When I Push it To Get a New View

I am reading many posts about UIViewController managing but I can't find the solution to my problem. I am making an iPhone game. I have three screens (menu, game play and scores) constructed into the Interface Builder and from three UIViewController classes. Into the main menu I have two custom buttons that allow to go to the game play screen or to the scores screen. Actually I am using the next method to navigate but when I use it, even it changes the screen and takes me to the game play, I can't see the highlighted state of the custom button. Must I change the views like this? How can I show the custom state of my buttons? How can I show an animation while the views are changing?

- (IBAction)gotoPlayViewController:(id)sender {

 //Navigation logic may go here.
 PlayViewController *playViewController = [[PlayViewController alloc] initWi开发者_C百科thNibName:@"PlayViewController" bundle:nil];

 self.view = playViewController.view;

 [playViewController release];
}

Thanks for readding.


You want to use UINavigationController, don't you?

The UINavigationController class implements a specialized view controller that manages the navigation of hierarchical content. This class is not intended for subclassing. Instead, you use instances of it as-is in situations where you want your application’s user interface to reflect the hierarchical nature of your content. This navigation interface makes it possible to present your data efficiently and also makes it easier for the user to navigate that content.

Here is a nice tutorial. Here is the class reference.


UINavigationController also provides a very easy way to add the slide transition you want.


Have fun!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜