Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clipsToBounds in React Native

Tags:

react-native

What is an alternative to clipsToBounds = true in React Native? I have subviews going beyond the bounds of a parent view. In iOS using swift, I would solve it with clipsToBounds = true

like image 941
Yana Khuchuieva Avatar asked Mar 21 '19 14:03

Yana Khuchuieva


1 Answers

You have to use the style property of your view and set overflow to hidden. Something like this:

<View style={{ overflow: ‘hidden’ }}>
   {/* These views won’t be presented out of the view */}
</View>
like image 160
Vladyslav Zavalykhatko Avatar answered Oct 24 '22 22:10

Vladyslav Zavalykhatko