Search Results

Search found 11 results on 1 pages for 'uiviewanimation'.

Page 1/1 | 1 

  • UIActivityIndicatorView is not display at the right time

    - by Alexandre
    I'm making a form that allows the user to enter datas in my IOS application. This form allows the user to enter a lot of repetive datas. So, sometimes, the process takes time and I would like to display a UIActivityIndicatorView during this process. Unfortunalty the spinner appears only one second or less at the end of the process, not at the beginning as expected. There is some code : - (void) manageSpinner{ spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0)]; // I do this becau I'm in landscape mode UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.tableView.bounds]; UIImage *image = [UIImage imageNamed:@"dark_gradiant.jpg"]; [imageView setImage:image]; [imageView addSubview:spinner]; [self.tableView addSubview:imageView]; [spinner startAnimating]; } //On click save by the user - (IBAction)save:(id)sender{ //Collect information from the form myObject.name = nameTF.text; [...] if(informations OK[...]){ //Manage spinner [self manageSpinner]; //Add : this is the long process for (int i=0; i<nbRepeatChooseByUser; i++) { [myObject register]; } //Call the delegate that will dismiss the form [self.delegate theSaveButtonOnTheAddMyObjectTVCWasTapped:self]; } } The spinner is called before the adding method but it seems to be set up after the process. Thank you, Alexandre

    Read the article

  • [iPhone] Background color during flip view animation/transition?

    - by Rob S.
    I have some pretty standing flipping action going on: [UIView beginAnimations:@"swapScreens" context:nil]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES]; [UIView setAnimationDuration:1.0]; [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1]; [UIView commitAnimations]; To Apple's credit, this style of animation is amazingly easy to work with. Very cool, and I've been able to animate transitions, flips, fades etc. throughout the app very easily. Question: During the flip transition, the background visible 'behind' the two views during the flip is white and I'd like it to be black. I've: Set the background of the containing view (self.view above) - no dice. I really thought that would work. Set the background of each view to black - no dice. I didn't think this would work although you give different things a shot to understand better :) Google'd like crazy; keep landing on Safari-related listings. Thanks in advance!

    Read the article

  • iPhone: scale UIView about a specific point

    - by Greg Maletic
    I want to animate the scaling down of a UIView, but not about its center: about a different point. As a shot in the dark, I tried translating the view, scaling, then translating back, using a series of CGAffineTransforms. But it doesn't work: it still scales about the center. Anyone know how to do this? Thanks very much.

    Read the article

  • How do I control the background color during the iPhone flip view animation transition?

    - by Rob S.
    I have some pretty standing flipping action going on: [UIView beginAnimations:@"swapScreens" context:nil]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES]; [UIView setAnimationDuration:1.0]; [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1]; [UIView commitAnimations]; To Apple's credit, this style of animation is amazingly easy to work with. Very cool, and I've been able to animate transitions, flips, fades etc. throughout the app very easily. Question: During the flip transition, the background visible 'behind' the two views during the flip is white and I'd like it to be black. I've: Set the background of the containing view (self.view above) - no dice. I really thought that would work. Set the background of each view to black - no dice. I didn't think this would work although you give different things a shot to understand better :) Google'd like crazy; keep landing on Safari-related listings. Thanks in advance!

    Read the article

  • UIView animation problem

    - by FoJjen
    I try to make a UIImageView open like a hatch, and under the "hatchView" its anoter imageView but when I start the animation its like the view under gets over and cover the animation, When the animation gets over the imageView the its getting visibel. its works fine if a remove the imageView thats under. Here is the code for animation view. - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *) event { if (!isHatchOpen) { if (hatchView.layer.anchorPoint.x != 0.0f) { hatchView.layer.anchorPoint = CGPointMake(0.0f, 0.5f); hatchView.center = CGPointMake(hatchView.center.x - hatchView.bounds.size.width/2.0f, hatchView.center.y); } UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInView:hatchView]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationBeginsFromCurrentState:YES]; float pct = location.x / 320.0f; float rad = acosf(pct); CATransform3D transform = CATransform3DMakeRotation(-rad+5, 0.0f, -1.0f, 0.0f); transform.m14 = (1.0 / -2000) * acosf(pct); hatchView.layer.transform = transform; [UIView commitAnimations]; isHatchOpen = YES; } else { if (hatchView.layer.anchorPoint.x != 0.0f) { hatchView.layer.anchorPoint = CGPointMake(0.0f, 0.5f); hatchView.center = CGPointMake(hatchView.center.x - hatchView.bounds.size.width/2.0f, hatchView.center.y); } [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationBeginsFromCurrentState:YES]; CATransform3D transform = CATransform3DMakeRotation(0, 0.0f, -1.0f, 0.0f); transform.m14 = 0; hatchView.layer.transform = transform; // Commit the changes [UIView commitAnimations]; isHatchOpen = NO; } } And here a add the Views hatchView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 1, frame.size.width-1, frame.size.height-2)]; [self addSubview:hatchView]; imageView = [[UIImageView alloc] initWithFrame:CGRectMake(1, 1, frame.size.width-2, frame.size.height-2)]; imageView.contentMode = UIViewContentModeScaleAspectFit; [self insertSubview:imageView belowSubview:hatchView];

    Read the article

  • addsubview animation works only first time

    - by Priya
    I am trying add subview with animation effect using the code which work fine for the first time below. CATransition *transition = [CATransition animation]; transition.duration = 1.0; transition.type = kCATransitionMoveIn; transition.subtype = kCATransitionFromRight; [newView.layer removeAllAnimations] [newView.layer addAnimation:transition forKey:nil]; [self.masterview addSubview:newView]; There is a back button in newView which removes the View from the superview. [newView removeFromSuperview]; Now when I try adding newView as subview again using the above code,its first adds the view as a subview(without animation) and again with animation.

    Read the article

  • UIView animation does not animate at first try?

    - by Bacalso Vincent
    Considering that my _palette's frame is like this: _palette.frame = CGRectMake(0,480,320,200); I have this code here to slide up/down a UIView: if(![_pallete superview]) { [self.view addSubview:_pallete]; [self.view insertSubview:_tempViewPaletteListener belowSubview:_pallete]; [UIView animateWithDuration:0.3 animations:^{ _pallete.top -= kPaletteHeight; } completion:^(BOOL isFinished) { }]; } else { [UIView animateWithDuration:0.3 animations:^{ _pallete.top += kPaletteHeight; } completion:^(BOOL isFinished) { [_tempViewPaletteListener removeFromSuperview]; [_pallete removeFromSuperview]; }]; } *the _tempViewPaletteListener is just a view with a tap gesture use to dismiss the palette* The problem is when I first try to run code here, the _palette view will just stiffly display right away. What I expected is, it should slide up the _palette view. Though it works fine after the first try

    Read the article

  • UIViewAnimation done by a UIViewController belonging to a UINavigationController?

    - by RickiG
    Hi I have an UINavigationController which the user navigates with. When pushing a specific UIViewController onto the navigation stack, a "settings" button appear in the navigationBar. When the user clicks this button I would like to flip the current view/controller, i.e. everything on screen, including the navigationBar, over to a settings view. So I have a SettingsViewController which I would like to flip to from my CurrentViewController that lives on a navigationController stack. I get all kinds of strange behavior trying to do this, the UIViews belonging to the SettingsViewController will start to animate, sliding into place, the navigationButtons moves around, nothing acts as I would think. -(void)settingsHandler { SettingViewController *settingsView = [[SettingViewController alloc] init]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES]; [self.navigationController.view addSubview:settingsView.view]; [UIView commitAnimations]; } The above results in the views flipping correctly, but the subviews of the SettingsViewController are all positioned in (0, 0) and after the transition, they 'snap' into place? Is it because I instantiate and add my subviews in viewDidLoad, like this? - (void)viewDidLoad { UIImageView *imageBg = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 460.0f)]; [imageBg setImage:[UIImage imageNamed:@"background.png"]]; [self.view addSubview:imageBg]; [imageBg release]; SettingsSubview *switchView = [[SettingsSubview alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 460.0f)]; [self.view addSubview:switchView]; [switchView release]; [super viewDidLoad]; } 1: How should I correctly do the "flip" transition, from within the UIViewController in the UINavigationController, to a new UIViewController and subsequently from the new UIViewController and back to the "original" UIViewController residing on the UINavigationControllers stack? 2: Should I use a different approach, than the "viewDidLoad" method, when instantiating and adding subviews to a UIViewController? -question 2 is more of a "best practice" thing. I have seen different ways of doing it and I am having trouble either finding or understanding the life-cycle documentation and the different threads and posts on the subject. I am missing the "best practice" examples. Thank You very much for any help given:)

    Read the article

  • Push a detail view in UITableViewCell class

    - by luca
    My class inherit from UITableViewCell, i have make some custom transitions to push a new detail view when an image get selected. [UIView transitionWithView:self.masterView duration:0.5 options:UIViewAnimationOptionShowHideTransitionViews animations:^ { [self.masterView addSubview:self.detailImage]; } completion:nil]; My code works fine, the detailImage subview is shown with a transition, but this transition is not what i want exactly. What i want to perform is a simple transition from bottom to up. The list of UIViewAnimation doesn't contain such animation. Is there any way to use that transition without changing my class inheritance to UINavigationController ?

    Read the article

  • UITableView : crash when adding a section footer view in empty section

    - by Supernico
    Hi everyone, This is the first time I ask a question here, but I have to say this site has been a tremendous help for me over the last couple months (iphone-dev-wise), and I thank you for that. However, I didn't find any solution for this problem I'm having: I have a UITableView with 2 sections, and no rows when the app is launched for the first time. The user can fill the sections later on as he wishes (the content is not relevant here). The UITableView looks good when filled with rows, but looks pretty ugly when there is none (the 2 header sections are stuck together with no white space in between). That is why I'd like to add a nice "No row" view in between when there is no row. I used viewForFooterInSection: - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { if(section == 0) { if([firstSectionArray count] == 0) return 44; else return 0; } return 0; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ if(section == 0) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 50, 44)]; label.backgroundColor = [UIColor clearColor]; label.textColor = [UIColor colorWithWhite:0.6 alpha:1.0]; label.textAlignment = UITextAlignmentCenter; label.lineBreakMode = UILineBreakModeWordWrap; label.numberOfLines = 0; label.text = @"No row"; return [label autorelease]; } return nil; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if(section == 0) { return [firstSectionArray count]; } return [secondSectionArray count]; } This works great : the footer view appears only when there is no row in section 0. But my app crashes when I enter edit mode and delete the last row in section 0: Assertion failure in -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cell animation stop fraction must be greater than start fraction' This does not happen when there are several rows in section 0. It only happens when there is only one row left. Here's the code for edit mode: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { // If row is deleted, remove it from the list. if (editingStyle == UITableViewCellEditingStyleDelete) { // Find the book at the deleted row, and remove from application delegate's array. if(indexPath.section == 0) { [firstSectionArray removeObjectAtIndex:indexPath.row]; } else { [secondSectionArray removeObjectAtIndex:indexPath.row]; } // Animate the deletion from the table. [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom]; [tableView reloadData]; } } Does anyone have any idea why this is happening? Thanks

    Read the article

1