blommegard / SBTickerView

An easy to use ticker view with inspiration from Flipboard
MIT License
378 stars 49 forks source link

animation problem with smaller image #3

Closed abrpatel closed 12 years ago

abrpatel commented 12 years ago

I'm trying to use an image 83 x 77 instead of the 100 x 160, and when i try to tick up and down, it animates with the other dimension. Is there something i can do to fix this issue.

blommegard commented 12 years ago

The ticker resize the front and back view to its own size, just change the ticker's size as well. I would recommend even sizes on the views too, they are easier to split in half. ;)

abrpatel commented 12 years ago

Thanks for the quick response. :) I've been playing around with your sample code since i woke up and understanding the dimensions the image needs to be to work properly. I know the golden ratio is being used 1 : 1.6. so just using the cat image, if it double the ticker size by 2, i.e 200 x 320 (size of the picture as well) i get the weird animation i noticed earlier.

I then divided the original ticker size by 1/2, i.e 50 x 80, and i get another weird animation transition.

p.s i figured out how to you gestures for view.

@property (nonatomic, strong) UISwipeGestureRecognizer *swipeUpGR; @property (nonatomic, strong) UISwipeGestureRecognizer *swipeDownGR; ``` UIGestureRecognizer *recognizer; recognizer = [[ UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(tickUp:)]; swipeUpGR = (UISwipeGestureRecognizer *)recognizer; swipeUpGR.numberOfTouchesRequired = 1; swipeUpGR.direction = UISwipeGestureRecognizerDirectionUp; //change Up to Right, Left or down [self.clockTickerViewHour addGestureRecognizer:swipeUpGR]; recognizer = [[ UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(tickDown:)]; swipeDownGR = (UISwipeGestureRecognizer *)recognizer; swipeDownGR.numberOfTouchesRequired = 1; swipeDownGR.direction = UISwipeGestureRecognizerDirectionDown; //change Up to Right, Left or down [self.clockTickerViewHour addGestureRecognizer:swipeDownGR]; ``` - (IBAction)tickUp:(UISwipeGestureRecognizer *)recognizer { [clockTickerViewHour tick:SBTickerViewTickDirectionUp animated:YES completion:nil]; } } - (IBAction)tickDown:(UISwipeGestureRecognizer *)recognizer { [clockTickerViewHour tick:SBTickerViewTickDirectionDown animated:YES completion:nil]; } }
blommegard commented 12 years ago

Ok, I will have to look in to that then, is it the same on both simulator and device?

The gestures I'm thinking of implementing is panning rather than swiping and is therefore a bit more complex. Thanks for all the info and I will look in to it.

abrpatel commented 12 years ago

I tried it on both, and it behaves the same way on both.

thanks. :D