question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
hramoscommented, Jun 26, 2017

Opening an issue doesn’t guarantee a fix, there’s over a 1,000 open right now that have been open for longer, I’m afraid.

You may consider adding screenshots or a link to a Snack as this may make it easier for people to reproduce the issue. Whoever embarks on fixing it has to do this anyway, so it’s respectful of their time to do this work ahead of time if you’re interested in seeing it fixed.

3reactions
Otobeliketheecommented, Jun 26, 2017

@hramos four days has gone, could you please give some help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android View clipped despite all it's parents being set to ...
Background: It's the classic problem of adding a view and moving it outside parent when it gets clipped. My hierarchy is as follows:....
Read more >
Relative Layout
RelativeLayout lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align...
Read more >
Making fine adjustments to a view's position
Fine-tune the position of the circle within the quadrant by using an offset modifier to shift where the parent view places the circle....
Read more >
core/java/android/widget/PopupWindow.java
This will cause the popup to be positioned in absolute screen coordinates.</p> ... @param parent a parent view to get the {@link android.view....
Read more >
Layout III: Layout Algorithms
... .com/platform/frameworks/base/+/master/core/java/android/view/View.java) and ... preferences (children will be clipped) - Parent *also decides* position ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found