View Doesn't render if it was a out of screen on Android
See original GitHub issueView doesn’t render if it was a out of screen. It works fine on iOS.
<Animated.View
style={[styles.wrap, { transform: [{ translateX: left }] }]}
>
{newPostExpected && (
<PostingLoaderBar />
)}
<Animated.View
style={[
styles.wrap,
{ paddingTop, transform: [{ translateY: listViewTop }] },
hasNavBar && { paddingTop: 60 },
]}
{...this.listViewResponder.panHandlers}
>
<ListView
ref={ref => this.listView = ref}
dataSource={posts}
renderRow={this.renderRow}
renderSectionHeader={this.renderHeader}
onEndReachedThreshold={2000}
pageSize={10}
onScroll={this.handleScroll}
onEndReached={this.getPosts}
enableEmptySections={true}
scrollEnabled={canScroll}
onChangeVisibleRows={(visibile, changed) => {
let lowestKey = null;
Object.keys(visibile).forEach((key, i) => {
if (i === 0) {
lowestKey = key;
} else if (key < lowestKey) {
lowestKey = key;
}
});
const notVisibleRows = Object.keys(changed).filter(key => !changed[key][0]);
if (notVisibleRows.length > 0) {
notVisibleRows.forEach(row => {
this[`feedItem${row}`].getWrappedInstance().resetOverlays();
});
}
if (this.state.postBlob[lowestKey]) {
this.topRowVoting = this.state.postBlob[lowestKey][0].voting;
}
}}
refreshControl={requiresRefresh && !singlePost ? (
<RefreshControl
refreshing={refreshing && !this.props.refreshing}
onRefresh={this.onRefresh}
/>
) : null}
onMomentumScrollBegin={() => {
this.hasMomentum = true;
}}
onMomentumScrollEnd={() => {
this.hasMomentum = false;
}}
/>
</Animated.View>
{hasComments && (
this.renderComments() // on Android it's render's an empty blank
)}
{singlePost && <View style={{ height: 60 }} />}
</Animated.View>
this.renderComments
just renders the following:
<CommentContainer
ref={ref => this.commentRef = ref}
comments={comments.data}
commentCount={comments.total}
routeBack={this.animateBack}
handleMove={this.handleMove}
animateForward={this.animateForward}
activePost={activePost}
parentId={null}
routeScene={this.props.routeScene}
incrementCommentCount={(increment) => this.incrementCommentCount(activePost.id, increment)}
refreshPost={() => this.refreshPost(activePost.id)}
/>
It works fine on iOS but on Android i’m getting empty blank instead of comments container
Additional information React Native version: 0.35.0 Platform(s) (iOS, Android, or both?): Android 5.1.1 Operating System (macOS, Linux, or Windows?): macOS
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:12 (1 by maintainers)
Top Results From Across the Web
My WebView does not render an HTML page if the screen is ...
WebView successfully renders html page even if the screen is off on android version pre 8.0/8.1 But it doesn't on Android 8.1. I...
Read more >Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
Read more >Android Player settings - Unity - Manual
Render outside safe area, Indicates whether the application should use all available screen space to render, including areas of the display that are...
Read more >Stack Navigator | React Navigation
If you set it to false , the screen won't animate when pushing or popping. Defaults to true on iOS and Android, false...
Read more >Common Flutter errors
The error is often caused when a ListView (or other kinds of scrollable widgets such as GridView ) is placed inside a Column...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shahen94
So the issue isn’t that it doesn’t render view out of screen, it’s just that
overflow: hidden
is default on Android and can’t be changed. So anything which is outside the view bounds (not the screen) will get hidden since the overflow is hidden. I think the issue title is misleading.@satya164 man I think you don’t understand issue correctly. I have no time to read what you did in your library. Try to read Android specification and you’ll find it out there.
Try to create empty app. create any view and move it out of the screen. It never will create. there are many solutions.
If you think that’s a bug, then report it to android. Because all realworld apps faced with this issue, WhatsApp/PicsArt/Momentum and solved it as i said