Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline not showing 'dots' when I have many elements on the list #18

Open
Schwarzenegger opened this issue Sep 11, 2017 · 16 comments
Open

Comments

@Schwarzenegger
Copy link

I'm having this problem on my android/ios, when I create a timeline with more than 10 elements the 'dots' start not showing up

screenshot_2017-09-11-16-50-07

screenshot_2017-09-11-16-50-09

I've already tried setting up minWidth on timeContainerStyle

@Hulva
Copy link

Hulva commented Sep 14, 2017

@Schwarzenegger Have you figure it out? I've got the same issue as you were...

@Hulva
Copy link

Hulva commented Sep 14, 2017

@Schwarzenegger I've fixed it by overriderenderCircle

@Schwarzenegger
Copy link
Author

@Hulva Yes, i figured it out by overiding renderCircle like you did.

Still messing it css to place the circle in the right place on all devices.

@Hulva
Copy link

Hulva commented Sep 15, 2017

@Schwarzenegger I've only played it on android... I didn't know that it'll display different on different device. Hope you'll find a good way to deal with it. Let me know if you do.

@linhanyang
Copy link

I also have the same problem on ios devices.

@danielgarciasantos
Copy link

i have some problem with icon, someone resolved?

@thegamenicorus
Copy link
Owner

Hi all.

Is it happen on emulator or real device?

@danielgarciasantos
Copy link

in both, debug...

@danielgarciasantos
Copy link

this problem is related to the initialListSize property, which by default is 10

@danielgarciasantos
Copy link

this problem is related to _renderCicle in circleStyle => left: this.state.x - (circleSize / 2) + ((lineWidth-1) / 2),

this.state.x may be zeroed due to _renderEvent's onLayout

onLayout
Invoked on mount and layout changes with:

{nativeEvent: {layout: {x, y, width, height}}}

This event is fired immediately once the layout has been calculated, but the new layout may not be reflected on the screen at the time the event is received, especially if the layout animation is in progress.

@danielgarciasantos
Copy link

any solution for this ?

@Schwarzenegger
Copy link
Author

Schwarzenegger commented Jan 12, 2018

@danielgarciasantos like I said, i overwrote renderCircle to look like this.

 renderCircle(rowData, sectionID, rowID) {
    var circleSize = 20
    var circleColor = rowData.circleColor
    var lineWidth = 2
    var ballPadding = (Platform.OS === 'ios') ? width/1.11 : width/1.10

    return (
       <View style={{
          width: 22,
           height: 22,
           borderRadius: 50,
           backgroundColor: circleColor,
           right: ballPadding
         }} />
     )
  } 

And the component

<Timeline
   style={timelineScreenStyle.list}
   data={this.state.data}
   timeContainerStyle={{minWidth:0}}
   detailContainerStyle={timelineScreenStyle.detailContainerStyle}
   separator={false}
   innerCircle={'none'}
   lineWidth={2}
   renderDetail={this.renderDetail}
   renderCircle={this.renderCircle}
   descriptionStyle={{color:'gray'}}
   enableEmptySections={true}
   options={{
     style:{paddingTop: 5}
    }}
    circleSize={22}
             />

It worked smooth for me on Android and IOs after this.

@dsah
Copy link

dsah commented Feb 15, 2018

overwrote renderCircle helped but circle position css is messed, its showing on the far right and line on the left.
timeline

@danielgarciasantos
Copy link

gave up component?

@naklow12
Copy link

Have same problem and I can't do overwrite just like you. Any other solution for this ?

@bhaskardabhi
Copy link

I am also facing issue while overriding renderCircle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants