Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad - No user interaction on view animated on-screen
    primarykey
    data
    text
    <p>Alright this is a newbie question, so I apologize in advance. I have a UIView which I laid out in Interface Builder off-screen. When the user presses a button, I would like to animate this view on-screen. It works, but I can't interact with any buttons in the UIView. I have read that only the view is moved when you animate and that the actual objects retain their positions, so I have tried setting the position of the UIViews' layers, but it causes my UIView menu to display an extra 81 pixels to the left. When this happens, I can interact with the buttons, but I need it to be flush with the right of the screen. Here is my code in the IBAction on the openMenu button:</p> <pre><code> CABasicAnimation *moveView = [CABasicAnimation animationWithKeyPath:@"position"]; moveView.delegate = self; moveView.duration=0.5; // If the menu is displayed, close it! CGPoint currentPosView = [[entirePage layer] position]; CGPoint destView; [moveView setFromValue:[NSValue valueWithCGPoint:currentPosView]]; if (menuDisplayed) { // Move right to our destination destView.x = currentPosView.x; destView.y = currentPosView.y + 81; [moveView setToValue:[NSValue valueWithCGPoint:destView]]; // Otherwise, open it } else { // Move left to our destination destView.x = currentPosView.x; destView.y = currentPosView.y - 81; [moveView setToValue:[NSValue valueWithCGPoint:destView]]; } // Animate the view [[entirePage layer] addAnimation:moveView forKey:@"move"]; // Set the final position of our layer [[entirePage layer] setPosition:destView]; menuDisplayed = !menuDisplayed; </code></pre> <p>And then in the animationDidStop method:</p> <pre><code> CGPoint currentPosMenu = [[menuBar layer] position]; if (menuDisplayed) { currentPosMenu.x -= 81; } else { currentPosMenu.x += 81; } [[menuBar layer] setPosition:currentPosMenu]; </code></pre> <p>Help???</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload