matteogobbi / MGSpotyViewController

Beautiful viewController with a tableView and amazing effects like a viewController in the Spotify app.
MIT License
1.02k stars 106 forks source link

How to detect gesture in overview section ? #2

Closed fvisticot closed 10 years ago

fvisticot commented 10 years ago

I try to add a gesture (UITapGestureRecognizer) callback on the small imageView but it is never called... Any idea ?

matteogobbi commented 10 years ago

Hi, UIImageView by default have user interaction disabled. Enable that property.

Sent from my iPhone

On 16/ago/2014, at 23:31, fvisticot notifications@github.com wrote:

I try to add a gesture (UITapGestureRecognizer) callback on the small imageView but it is never called... Any idea ?

— Reply to this email directly or view it on GitHub.

fvisticot commented 10 years ago

I have tried this proposal but does not work… Any other idea ?

[imageView setContentMode:UIViewContentModeScaleAspectFill];
[imageView setClipsToBounds:YES];
[imageView setImage:[UIImage imageNamed:@"example"]];
[imageView.layer setBorderColor:[UIColor whiteColor].CGColor];
[imageView.layer setBorderWidth:2.0];
[imageView.layer setCornerRadius:imageView.frame.size.width/2.0];    
[imageView setUserInteractionEnabled: YES];

UITapGestureRecognizer* recognizer = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(userSettingsClicked:)];
recognizer.delegate=self;
[recognizer setNumberOfTapsRequired : 1];
[imageView addGestureRecognizer: recognizer];

+

Le 16 Aug 2014 à 23:51, Matteo Gobbi notifications@github.com a écrit :

Closed #2.

— Reply to this email directly or view it on GitHub.

matteogobbi commented 10 years ago

Oh sorry, the problem is that actually there is the tableView over that image. So the tap is captured by the table.

fvisticot commented 10 years ago

Do you plan to update the component ? If not, can you please provide any advice to make it works ?

Le 17 Aug 2014 à 02:02, Matteo Gobbi notifications@github.com a écrit :

Oh sorry, the problem is that actually there is the tableView over that image. So the tap is captured by the table.

— Reply to this email directly or view it on GitHub.

fvisticot commented 10 years ago

Hello Matteo, Sorry to disturb view again but did you have a solution / advice ? I really would like to use this nice component ?

Is there any other alternative to your control ? Tinder app is using this kind of component and I really like it (blur animation is really smooth)

Tx for your help

Fred

Le 17 Aug 2014 à 11:52, Fred Visticot fvisticot@gmail.com a écrit :

Do you plan to update the component ? If not, can you please provide any advice to make it works ?

Le 17 Aug 2014 à 02:02, Matteo Gobbi notifications@github.com a écrit :

Oh sorry, the problem is that actually there is the tableView over that image. So the tap is captured by the table.

— Reply to this email directly or view it on GitHub.

matteogobbi commented 10 years ago

Hi,

unfortunately ATM i’m really busy and i can’t work on the component to study some way.

fvisticot commented 10 years ago

OK, no pb I found a workaround with gesture recognizer… not perfect but it works :) I show your component to some people, good feedback but it seems that blur effect is not perfect… (could be better as in Tinder app)

Regards

Fred

Le 22 Aug 2014 à 10:15, Matteo Gobbi notifications@github.com a écrit :

Hi,

unfortunately ATM i’m really busy and i can’t work on the component to study some way. — Reply to this email directly or view it on GitHub.

alr commented 9 years ago

Hi, fvisticot

Could you describe your workaround?

Thanks

matteogobbi commented 9 years ago

Fvisticot of you have a nice solution ask for a pull request please.