Skip to content

[Android]View positioned as absolute was clipped by parent view #14671

Description

@Otobelikethee

Description

parts of child View which exceed border of parent View should be expected to be visible but not clipped. style parent View with overflow: visible cannot make it either. IOS is ok

Reproduction Steps

run sample code below

Sample Code

const { width, height } = Dimensions.get('window');

<View style={[{ backgroundColor: '#fff'}]}>
    <ScrollView
      decelerationRate={0.99}
      horizontal={true}
      alwaysBounceHorizontal={true}
      showsHorizontalScrollIndicator={false}
      contentContainerStyle={{paddingLeft: 6, paddingRight: 32, justifyContent: 'center', alignItems: 'center' }}
    >
    {
      list.map((item, index) => {
        return (
          <View style={[{ height: 36, backgroundColor: '#fff', paddingHorizontal: 6, justifyContent: 'center'}]} >
            <Text>{item}</Text>
          </View>
        )
      })
    }
    </ScrollView>
    <View style={{ position: 'absolute', width: width, top: 36, height: 200, borderBottomWidth: 1, borderBottomColor: '#ccc' }}>
      <Text>apple</Text>
      <Text>banana</Text>
      <Text>tea</Text>
      <Text>tomato</Text>
      <Text>chicken</Text>
    </View>
</View>

Solution

Any solution is appreciated.

Additional Information

  • React Native version: 0.45.1
  • Platform: Android
  • Development Operating System: macOS
  • Build tools: Android Studio 2.3.3, Android SDK Tools 26.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions