1

I have a view that takes a pan gesture. So that view can translate. I gradually want to change the alpha of the view taking the pan gesture from 1.0 to 0.0 as it is moving close to another view so that there is no abrupt overlapping of the frames of two views. How can i achieve this?

shshnk
  • 1,621
  • 14
  • 26

2 Answers2

0

I do not think there is a method for assigning different alpha value to different region of a single view.

As a workaround, you can have an overlay view with same color as the background, or set an image on the view which has gradually increasing alpha and allow the target view to slide under this overlay view.

metsburg
  • 2,021
  • 1
  • 20
  • 32
0

You have to do some work in a CALayer, Check the answer by @robmayoff from below SO question, I think it could help:

How to apply partial fade in-out in IOS?

Community
  • 1
  • 1
Tarek Hallak
  • 18,422
  • 7
  • 59
  • 68