core-animation

UIView displays improperly after its layer has been animated

十年热恋 提交于 2019-12-11 08:25:15
问题 I have a problem I don't understand regarding UIViews and Core Animation. Here's what I want to do: A small view is presented above a bigger view by putting it as one of its subviews. When I click a button inside this view, the view should minimize and move to a specified CGRect. Then the view is removed from its superview. The first time I present, minimize-and-move and remove the view, everything works fine. But when I present the view again, it displays at the modified position (even

animation: how to animate a view using layer?

旧城冷巷雨未停 提交于 2019-12-11 08:13:03
问题 Image showing what I would like to achieve I want to move a view animately from a position to a new postion. If update the layer position of a view, I think the view will animately move to the new position, which is implicit animation I guess, but there's no animation, why? - (IBAction)startAnimation:(id)sender { CGPoint position = self.imageView.layer.position; position.y += 90; self.imageView.layer.position = position; } 回答1: Implicit animations only happen for standalone layer, not layers

iPhone SDK: After a certain number of characters entered, the animation just won't load

孤人 提交于 2019-12-11 07:47:34
问题 Okay, this is the code: [lblMessage setText: txtEnter.text]; [lblMessage sizeToFit]; scrollingTextView.contentSize = lblMessage.frame.size; float width = (lblMessage.frame.size.width) + (480); [UIView beginAnimations:@"pan" context:nil]; [UIView setAnimationDuration:durationValue]; [UIView setAnimationRepeatCount:5]; scrollingTextView.contentOffset = CGPointMake(width,0); [UIView commitAnimations]; //The scrolling text view is rotated. scrollingTextView.transform =

Animating a UITextView increasing or decreasing the value of a number

ぃ、小莉子 提交于 2019-12-11 07:41:48
问题 I have a UITextView that displays a value (ex. "32039"). Frequently in my app I change the value of that number, but want to animate the increase or decrease in value. The animation I have in mind is something like this. I've seen this question but the only animations possible using the method described in the answers are those like fade in/out, move in from left/right/down/up, and reveal/push. Is there a UIKit or Core Animation implementation of this animation, or even an implementation in a

Fast, 2 Dimensional Table View

久未见 提交于 2019-12-11 07:05:14
问题 I'm implementing a view for displaying tabular information with 2 axis, but I'm starting to run into performance issues with rendering all the cells. The view looks something like this: +------------+-------------+------------+------------+------------+ | | 12.00am | 1.00am | 2.00am | 3.00am | +------------+---------+---+---+--------+--------+---+-+---+------+ | Category 1 | x | x | x | x | x | | +------------+---------+-------+-----+-----------+-----+---+------+ | Category 2 | | x | x | +---

Multiple drawLayer:

こ雲淡風輕ζ 提交于 2019-12-11 07:00:25
问题 how can i use drawLayer for multiple layers in one class? I was thinking maybe something like this: - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { if(layer == layer1) { //do this } if(layer == layer2) { //do something else } } how would i do that? 来源: https://stackoverflow.com/questions/4579795/multiple-drawlayer

How to mimic UINavigation animation behavior when transitioning between two UITableViews

隐身守侯 提交于 2019-12-11 05:16:49
问题 I have a UIViewController that houses two UITableViews and swaps between the two. I'm wondering how can I implement the exact same animation behavior that a UINavigationController does when transitioning between these two UITableViews? (ie one tableView gets pushed off the screen left to right or right to left by the other tableView). 回答1: // Set table 2 up offscreen as starting state CGRect rect = tableView2.frame; rect.origin.x = rect.size.width; tableView2.frame = rect; // fill in any

Subclassing CALayer + Implicit Animation w/ Swift3

浪尽此生 提交于 2019-12-11 04:22:58
问题 I am trying to implement "implicit animations" by overriding CALayer. I've read through the documentation and find it rather complicated. More over, I can't find any decent code examples, or internet posts explaining it well or using any Swift. I've implemented by subclass BandBaseCG which attempts to provide implicit animation for property param1 , and overridden needsDisplay(forKey:) which does get called once with my property where I return true. But here is where it goes wrong. My

Flipping a Window in Cocoa

人走茶凉 提交于 2019-12-11 04:05:05
问题 How can I flip an NSWindow so I can press a button, and the window will "flip" like on Dashboard and the content view of the NSWindow changes. 回答1: Step 1: Center the window on a vertically-aligned fulcrum. Step 2: Push down on one side. OK, that's not it. ☺ Mike Lee wrote one and put it in the public domain, and Drew McCormack improved it. Rainer Brockerhoff wrote one, too, and put his under an MIT license. So you have your choice. 来源: https://stackoverflow.com/questions/2490069/flipping-a

Making a ball/circle move in cocoa using nsbezierpath(objective -c))?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 03:46:15
问题 I am trying to Create a point on an image when the application runs and then try to move the point slowly to a different location. here is my code.This code works but there are two problems. First, The processing has already happened before the window loads so I see only the finished result.(I want to show one point moving to another point in the image) Second,The previous point is not removed when I create a new point.So it doesn't look like the point is moving rather it looks like it is