Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Scrollview disable clipping
Hey guys By default, the scrollView is clipped and the shadow is obscured. Going to the trouble of attaching padding to an element adds complexity to the layout. The way I'm handling this is going to be a much more maintainable code. Put the following code anywhere you want import UIKit extension UIScrollView { open override var clipsToBounds: Bool { get { false } set { } } } Controls UIKit's UIScrollView's clipsToBounds. This will then be reflected in the SwiftUI's ScrollView and the clip will no longer function. Now there is no need to bother adding padding to the element. And the shadow will not be clipped! I recommend this for more infomation https://github.com/ramen2020/ScrollView-clipsToBounds/tree/main
Mar ’23