Search Results

Search found 8 results on 1 pages for 'uianimation'.

Page 1/1 | 1 

  • Problems with transitionWithView and animateWithDuration

    - by MusicMathTech
    I have problems with transitionWithView and animateWithDuration. One of my animateWithDuration blocks doesn't transition, it is a sudden change, and transitionWithView does not temporarily disable user interaction. I have checked the docs and believe I am doing everything correctly, but obviously something is wrong. Here are the two blocks of code: This is in my main View Controller ViewController which has three container views/child view controllers. This block moves one of the container views, but does not block the user from other interactions in ViewController while the transition is occurring. [UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^ { CGRect frame = _containerView.frame; frame.origin.y = self.view.frame.size.height - _containerView.frame.size.height; _containerView.frame = frame; }completion:^(BOOL finished) { // do something }]; This is in one of my container view controllers. The animation seems to have no effect as the text of the productTitleLabel and productDescriptionTextView changes suddenly as if the animation block does not exist. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.viewController toggleFlavoredOliveOilsTableView]; if (indexPath.row > 0) { NSDictionary *selectedCellDict = [[_flavoredOliveOilsDict objectForKey:@"Unflavored Olive Oils"] objectAtIndex:indexPath.row - 1]; [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^ { self.viewController.productTitleLabel.text = [_flavoredOliveOilsTableView cellForRowAtIndexPath:indexPath].textLabel.text; self.viewController.productDescriptionTextView.text = [selectedCellDict objectForKey:@"Description"]; }completion:nil]; if (indexPath.row == 1) { [self.viewController setProductDescriptionTextViewFrameForInformationTab]; } else { [self.viewController setProductDescriptionTextViewFrameForNonInformationTab]; //self.viewController.productImageView.image = [UIImage imageNamed:[selectedCellDict objectForKey:@"Image"]]; } } } I think the problems are somewhat related as most of my animation and transition blocks don't work completely as expected. Thanks for any help. Edit What I am trying to accomplish is moving a container view in ViewController and set the text and image properties of a label, text view, and image view; all of which are in the main view. The details of these properties are sent via the child view controller. The transitionWithView is in a method called toggleFlavoredOiveOilsTableView which is called in didSelectRowAtIndexPath. I think the problem is that I am trying to call two different animation/transition blocks at the same time.

    Read the article

  • Change UITextView text color with animation.

    - by f0rz
    Hi ! Just a simple question. Is it possible to change the text color of UITextView with a animation? [UITextView beginAnimations:nil context:NULL]; [UITextView setAnimationDuration:2.0]; textView.textColor = [UIColor grayColor]; [UITextView commitAnimations]; Cheers! - Martin

    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

  • UITableView Animation when entering Editmode

    - by f0rz
    Hi! Maybe I´m just stupid but I cant understand why this isnt working. I want to achieve a little animation when I'm entering editing mode within a UITableView. [super setEditing:NO animated:YES]; [myTable setEditing:NO animated:YES]; [myTable reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Edit"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStylePlain]; Shouldnt this animated:YES suppose to animated this entering of the editmode? Regards. - f0rz

    Read the article

  • Animation on single UIWebView

    - by Shri
    I have searched quite a bit(sample one, Sample two) but cant seem to get the correct answer. I have a webview on my XYZ view controller class. When i press on a button, it takes an URL from an array and re-loads the same webview. Now I need to do the flip book animation on it. Same webview should be reloaded. That is the webview should rotate around its own axis 180/360 degree while the loading of next url is going on. Is this possible?

    Read the article

  • Moving a sprite around the circumference of a circle in Cocos2d-iPhone

    - by CircleOfLife
    I am new to Cocos2d. I have taken a look at the documentation at it looks pretty simple compared to what you need to do using basic Iphone classes such as UIAnimation etc. I want to move a Sprite (eg. Bird, Plane or Car) around the center of a circle around its circumference, smoothly so that even the sprite rotates accordingly. How is this possible in Cocos2d? It would be very helpful if someone can post some basic code. Thanks.

    Read the article

1