PGSSoft / ParallaxView

tvOS controls and extensions that add parallax effect to your application.
https://pgssoft.github.io/ParallaxView/
MIT License
481 stars 50 forks source link

Make glow effect centered by default on focused state #8

Closed harimani closed 4 years ago

harimani commented 6 years ago

Hi, I am trying to make the glow effect centered to the view by default on focused state like how Apple does it. Can you please help me how to achieve it with this framework. Thanks.

nonameplum commented 6 years ago

Hey, Yeep for sure this is doable. Unfortunately, this is not something explicitly exposed as a configurable thing with the current implementation. But what you can do is to take a look at: https://github.com/PGSSoft/ParallaxView/blob/master/Sources/Views/ParallaxView.swift#L47 You can create your custom subclass over ParallaxView to implement overridden version of the layoutSubviews method.

harimani commented 6 years ago

Thanks for your response Lukasz!

Actually i tried overriding ParallaxView's layoutSubviews method as like how you did in the example app, but it didn't work out for me. Can you please send me your working code snippet of layoutSubviews to achieve it.

Also, it would be great if you make it configurable as part of your framework.

On Mon, Feb 12, 2018 at 5:11 PM, Łukasz Śliwiński notifications@github.com wrote:

Hey, Yeep for sure this is doable. Unfortunately, this is not something explicitly exposed as a configurable thing with the current implementation. But what you can do is to take a look at: https://github.com/PGSSoft/ParallaxView/blob/master/ Sources/Views/ParallaxView.swift#L47 You can create your custom subclass over ParallaxView to implement override version of the layoutSubviews method.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PGSSoft/ParallaxView/issues/8#issuecomment-365095239, or mute the thread https://github.com/notifications/unsubscribe-auth/ADs9-JTXOgUnchX7A6Agd4hv02_kDcpnks5tUMUcgaJpZM4SBtgK .

nonameplum commented 4 years ago

Hey @harimani We added ability to customize the glow effect position in the release https://github.com/PGSSoft/ParallaxView/releases/tag/3.1.1 Please take a look at glowPosition property (https://github.com/PGSSoft/ParallaxView/blob/master/README.md#customisation). Also you might take a look at updated example app. https://github.com/PGSSoft/ParallaxView/blob/94804fd6f44b569dea6bc758aeeff46d31242a29/Example-tvOS/ParallaxViewExample/CollectionViewCell.swift#L23