Dynamic height based on content
All of the examples show heights expanding to fill containers. Is there any way to have the masked view expand/contract based on the size of text content?
hi, did u solved this? The biggest problem of maskview is's requiring height for below component
Render maskElement at children too.
If you need, you have to hide and ignore touch event with opacity or pointerEvents
<MaskedView maskElement={<>{children}</>} {...viewProps}>
{/* layout purpose */}
<View style={{ opacity: 0 }} pointerEvents={'none'}>
{children}
</View>
<LinearGradient.../>
</MaskedView>
nice
Render
maskElementatchildrentoo. If you need, you have to hide and ignore touch event withopacityorpointerEvents<MaskedView maskElement={<>{children}</>} {...viewProps}> {/* layout purpose */} <View style={{ opacity: 0 }} pointerEvents={'none'}> {children} </View> <LinearGradient.../> </MaskedView>
I think I will took more performance
sure, so I use this only icon and texts.
Render
maskElementatchildrentoo. If you need, you have to hide and ignore touch event withopacityorpointerEvents<MaskedView maskElement={<>{children}</>} {...viewProps}> {/* layout purpose */} <View style={{ opacity: 0 }} pointerEvents={'none'}> {children} </View> <LinearGradient.../> </MaskedView>
This really works for me! Thanks!