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.

How to set the `borderBottomColor` of `ListItem`

See original GitHub issue

I want to set the borderBottomColor of the ListItem, but check out the API and did not tell me.

“react-native-elements”: “^0.18.2”,

image

code:


const list2 = [
  {
    name:
      'Amy Farha Amy Farha Amy Farha Amy Farha Amy Farha Amy Farha Amy Farha Amy Farha',
    avatar_url:
      'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg',
    subtitle: 'Vice President'
  },
  {
    name: 'Chris Jackson',
    avatar_url:
      'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg',
    subtitle: 'Vice Chairman'
  },
  {
    name: 'Amanda Martin',
    avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/brynn/128.jpg',
    subtitle: 'CEO'
  },
  {
    name: 'Christy Thomas',
    avatar_url:
      'https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg',
    subtitle: 'Lead Developer'
  },
  {
    name: 'Melissa Jones',
    avatar_url:
      'https://s3.amazonaws.com/uifaces/faces/twitter/nuraika/128.jpg',
    subtitle: 'CTO'
  }
];

        <List containerStyle={{ marginBottom: 20, borderColor: '#eee' }}>
          {list2.map((item, index) => (
            <ListItem
              containerStyle={{ borderColor: '#eee' }}
              wrapperStyle={{ borderColor: '#eee' }}
              roundAvatar
              avatar={{ uri: item.avatar_url }}
              key={index}
              onPress={log()}
              title={item.name}
              subtitle={item.subtitle}
              titleNumberOfLines={1}
              badge={{
                value: 3,
                textStyle: { color: 'orange' },
                containerStyle: { marginTop: 0 }
              }}
            />
          ))}
        </List>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

3reactions
xavier-villelegiercommented, Nov 2, 2018

Hey @fengyun2 You can use the containerStyle props on the ListItem to control the border color 👍

<ListItem
  containerStyle={{ borderBottomColor: 'red' }}
  …
/>
0reactions
iRoachiecommented, Dec 14, 2018

@nihp can you create a new issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to add style (add bottom border )in all li in react?
I want to add style in all li (add bottom border) .one way is to add this className={classes.sideBar__listItem__element} in all ListItem is ...
Read more >
react native - changing border color of list item or list - mitzen
... you have need to set List's containerStyle -> borderColor and ListeItem's containerStyle ->BorderBottomColor to your desired color.
Read more >
<display-listitem> - CSS: Cascading Style Sheets | MDN
The list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its list-style properties (for ...
Read more >
Changing the bottom-border color in a List View - Telerik
I am trying the following code to change the border bottom color of an 'li' element in a list-view. http://dojo.telerik.com/ApIp/27.
Read more >
Borders - MUI System
borderBottomColor, borderBottomColor, border-bottom-color, palette. borderLeftColor, borderLeftColor, border-left-color, palette.
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