How to create text border in React Native?

前端 未结 9 1569
清歌不尽
清歌不尽 2021-02-01 14:14

In React-Native, how do I add font borders to Text-components?

I\'ve tried using border and shadow{Color, Radius, Opacity, Offset}, but haven\'

9条回答
  •  心在旅途
    2021-02-01 14:21

    I needed to add a bottom border to Text component like this:

    I did the following:

    the border is a inside another one with flexDirection : 'row'

    here is my code:

    
       Horaire de prière
       
         
       
    
    
    

    and the style:

    titleContainer: {
        flex: 0.2,
        alignItems:'center',
        justifyContent:'center'
    
      },
      title: {
        fontSize: 18,
        marginBottom:2,  
      },
      borderContainer:{
        flexDirection:'row',
        alignItems:'center',
        justifyContent:'center',
    
      },
      border:{
        flex:0.28,
        borderBottomWidth: 1,
        borderBottomColor: '#428947',
    
      },
    

    you can modify border size with flex.

提交回复
热议问题