Home > Mobile >  Creating inner shadows in UIView to replicate Neumorphic Style
Creating inner shadows in UIView to replicate Neumorphic Style

Time:10-21

I have the task to implement neumorphic design styles in my UIKit application. I have successfully implemented the double outer shadows (dark and light), but I somehow, can't figure it out how to implement the inner shadows inside the view. I've tried approaches like CAGradientLayer that goes from .black to .clear to .white, but it isn't looking the way it is supposed to. I've searched the internet for various solutions, but couldn't seem to find one apropiate one.

How should I create the inner shadows? What approach should I use? I am fine with a solution in either Swift or Objective-C.

enter image description here

This is the result:

enter image description here

By tweaking the colors, shadow properties, etc, this may give you your desired result.

CodePudding user response:

If I remember well, you have to create an overlay containing the blurred shape, clipped to the shape. With the clipping, the outside part of the blur will disappear, and you will just have the inner blur as a shadow.

  • Related