curl up navigation on view based application in ios apps - iphone

i have faced some problem while navigating from one class to another with the curl-up animation style
i have did 2 test projects one with View based application & another navigation based application & also created 2 classes in each and a button on the first screen
following is my event handler for that button
-(IBAction)OnclickButton
{
SecondViewController * viewController = [[[SecondViewController alloc] initWithNibName:nil bundle:nil] autorelease];
[UIView transitionWithView:self.view.window
duration:1.0f
options:UIViewAnimationOptionTransitionCurlUp
animations:^{
[self.navigationController pushViewController:viewController animated:NO];
}
completion:NULL];
}
my problem is
project with navigation based template is working fine its navigating to second page with curl up animation ,,
but
in the project with navigation based template ,its not navigating to the second page on click of the button instead it will give curl up effect n reload the same page
why its happening so,, i am planing to apply this curl up animation to my existing project which is created in view based template
can any one tell where i gone wrong,,, how can i navigate with curl up animation(but not using the partial animation API)
thanx in advance

B'coz you set self.view
transitionWithView:self.view.window
you need to change view which you call..

Related

UIViewAnimationCurveLinear Hide View Completely

I'm trying to switch between two views by using the page curl effect in UIViewAnimationCurveLinear but when I execute this animation, the top of the page curl stays present on the second view.
I implement this action by using
-(IBAction)menu:(id)sender{
MenuViewController *view=[[MenuViewController alloc] initWithNibName:nil bundle:nil];
view.modalTransitionStyle=UIViewAnimationCurveLinear;
[self presentModalViewController:view animated:YES];
}
Anyone know how to completely remove the previous view from the screen? Thanks in advance.
UIViewAnimationCurveLinear is not a modal transition style. If you want page curl then you probably want UIModalTransitionStylePartialCurl.

iphone:In view based application how can I move from 4th screen to 1st screen

I am creating view based application and in this application I want to directly switch over to 1st screen from 4th screen then how can I do this?
My code to go to next view is as follows:
NewProposalDetail *newDetail = [[NewProposalDetail alloc] initWithNibName:#"NewProposalDetail" bundle:nil];
[self presentModalViewController:newDetail animated:YES];
[newDetail release];
Any idea?
if yes then share it
The same way you switch screens using pushViewControllers and popViewControllers to any other screen. Use
[self.navigationController popToRootViewControllerAnimated:YES];
The first view is the root view you see so simply put this line and it will pick up the firstView.

How can I display a introduction modal view when the app start up?

I have a tab bar application and I want to display those views that most part of apps have, with the name of the company or the name of the app.
I've created the follow viewController
Introduction *introducao = [[Introduction alloc] initWithNibName:#"Introduction" bundle:nil];
I don't know where exactly should I insert the code to show the modal because I have a tab bar application:
[self.navigationController presentModalViewController:galeria animated:YES];
I've tried to insert these lines on appDelegate.. but didn't work.. somebody have an idea?
if you are trying to show a splash screen right when the application opens, you should use a Default.png image instead of a view controller showing an image. Check out the Apple Documentation on Human Interface Guidelines and Beginning iPhone Development.
First of all, you'll need to ensure that you have a navigation controller present to present the model view from. Otherwise in the above code you'll be messaging nil and nothing will happen. Then you'll want to put the presentModalViewController:animated: call in your app delegate's applicationDidFinishLaunching: implementation.
Thanks for all answers.. they were very useful to understand better the process..
I have found a solution that does exactly what I need! So if someone need to create those splash screens with a sequence of images it is very useful:
Just create a ImageView on the Delegates Header and do the following:
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashView.image = [UIImage imageNamed:#"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
to control the duration of the splash screen:
[self performSelector:#selector(removeSplash) withObject:nil afterDelay:1.5];
To remove the splash:
-(void)removeSplash;
{
[splashView removeFromSuperview];
[splashView release];
}
so If you want to create a sequence of image just create a method to change the splashView.image.. and create a NSTIMER to call it..

how to use two navigation controller in same page for iPhone Application

I have been used no. of page in my app. and i am pushing one from other.All data are are coming from from server.In every page one part of page is fixed at start while pushing remaing part of page is pushed . This is working fine. even i have used back button all things are doing fine But the problem arises when i reached to last page then i want two buttons at top , once going just to previous page and another goes to start page.the previous buttons buttons work fine but next button creates problem it will goes to 1st page but fixed part of page gone blank. i will giving code as follow:
-(IBAction)btnHome_Click:(id)sender
{
TweetListing *rit= [[TweetListing alloc] initWithNibName:#"TweetListing" bundle:[NSBundle mainBundle]];
addNavigationController = [[UINavigationController alloc] initWithRootViewController:rit];
[self.navigationController presentModalViewController:addNavigationController animated:NO];
}
-(void) viewWillAppear:(BOOL)animated
{
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:#"Home" style:UIBarButtonItemStylePlain
target:self action:#selector(btnHome_Click:)];
}
so please provide some code to solve this problem
You probably don't want to manage this UI with the navigation controller. To add a back, forward, and reload button, simply add a toolbar to the bottom of the View, and add the necessary UIBarButtonItems. Apple includes a bunch of very useful ones that look like Mobile Safari in Interface Builder.

how can I call a screen with a button action (xcode)?

I am developing a Window Based app for iPhone. I use Interface Builder to build Interface. I want to call a new screen with a Button Action. How can I call the screen with Button action ?
By pushing the new controller onto the top of the stack of windows. For example:
EnterNameController *newEnterNameController = [[EnterNameController alloc] initWithNibName:#"EnterName" bundle:[NSBundle mainBundle]];
[[self navigationController] pushViewController:newEnterNameController animated:YES];
Apple has an extraordinary amount of sample code, and this question (as well as many others) could easily be solved by simply visiting Apple's iPhone dev site.
iPhone Dev Site
If you are using a navigation controller, push it onto the navigation controller's stack, as alamodey suggested.
If you want it to be a modal controller (that is, slide up from the bottom and cover the previous controller's view, like the Bookmarks screen in Safari), present it as a modal view controller:
[self presentModalViewController:myNewController animated:YES];
When you want to bring the old controller back, dismiss the modal view controller. From inside the modal view controller:
[self.parentViewController dismissModalViewControllerAnimated:YES];
If you don't want to do either, just remove the current controller's view from the window and add the new controller's:
UIView * containingView = self.view.superview;
[self.view removeFromSuperview];
[containingView addSubview:myNewController.view];
If you go this route, you may want to look into +[UIView beginAnimations:context:], +[UIView setAnimationTransition:onView:], and +[UIView commitAnimations] (if I recall the method names correctly--check the documentation) to animate the transition. You should almost always animate any switch between screens in iPhone OS.
(work in .m class)
#import "classtocall.h"
- (IBAction)ButtonPressed:(id)sender
{
classtocall *mvc = [[classtocall alloc]initWithNibName:#"classtocall" bundle:nil];
[self presentModalViewController:mvc animated:NO];
}
(for window based application)
define in .h class
- (IBAction)ButtonPressed:(id)sender;
where "classtocall" is the class you want to call.
you just need to download sample applications from XCode help. Try Elements and UIcatalog. There are also other - type 'pushViewController' or 'addSubview' adn 'makeKeyAndVisible' in help and download samples
nextscreenViewController *login = [[self storyboard] instantiateViewControllerWithIdentifier:#"nextscreenidentifier"];
nextscreenidentifier.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController: nextscreenidentifier animated: YES];