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

Render Circle displays icons to far right of 2 column #64

Open
shubhamverma27 opened this issue Apr 5, 2019 · 3 comments
Open

Render Circle displays icons to far right of 2 column #64

shubhamverma27 opened this issue Apr 5, 2019 · 3 comments

Comments

@shubhamverma27
Copy link

I am trying to display a custom view which includes an icon for the circle using renderCircle in a single column left. I can see that my custom view is being rendered. The only issue is that the custom circle is being rendered to the far right of the screen instead of down the middle line that is rendered. Do I maybe need to change more styles or is this a bug?

@bhaskardabhi
Copy link

Same is happening for me.

@alihaider123go
Copy link

Same for me.

@jspizziri
Copy link

jspizziri commented Oct 30, 2020

In case people are still struggling with this the answer is "Yes". You do need to add some additional style, as the native _renderCircle method manually positions the circles relative to other dimensions.

The renderCircle function you pass into the component is bound to the component. So you can do something like this:

<Timeline
  data={data}
  renderCircle={function (item, index) {
    let circleSize = 9;
    if ([some criteria to identify your custom circle]) {
      return (
        <View
          style={{
            width: circleSize,
            height: circleSize,
            backgroundColor: 'blue',
            right: this.state.width - circleSize / 2 - (lineWidth - 1) / 2,
          }}
        />
      );
    }

    return this._renderCircle(item, index);
  }}
/>

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

4 participants