-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Closed
Copy link
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
hi, this code shows different result on android and iOS:
export default class TestClip extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.child}/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
width: 100,
height: 100,
backgroundColor: 'red',
},
child: {
position: 'absolute',
width: 100,
height: 100,
top: 50,
left: 50,
backgroundColor: 'green',
},
});
I think this is caused by:
on android ViewGroup's clipChildren is true by default,
on iOS UIView's clipToBounds is NO by default.
Tested adding setClipChildren(true) to the base class ReactViewGroup on android can solve this, but not sure if this can cause performance issue. maybe exporting clipChildren as a property on both platform is better?
- React Native version: 0.37.0
- Platform: iOS & Android
- Operating System: MacOS
benvium, oleg-deezus, hellogerard, cyprusglobe, RyGuyM and 9 morehellogerard and Hamiltontx
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
