Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28463

Layout design in react native

$
0
0

I am trying to design below layout in react native.

I am not able to draw horizontal line as shown above. Some how I have drawn but margin on the right is not being appliedLAYOUT IN REACT NATIVE

Code

<View style={{ flexDirection: 'row' }}>
                    <Text style={styles.text}>
                        Search
                </Text>
                    <View style={styles.viewStyleForLine1}></View>
                </View>

Style

viewStyleForLine1: {
        borderWidth: 1,
        borderColor: '#cc0000',
        alignSelf: 'stretch',
        marginLeft: 5,
        marginRight: 5,
        width:"100%"
    },

More edit on centering the content

Here is how my View is

<View style={{ flexDirection: 'row' }}>
            <Text style={styles.text}>
             Search</Text>
            <View style={styles.viewStyleForLine1}></View>
            </View>

Style

text: {
        marginTop: 16,
        fontSize: 30,
        fontWeight: 'bold',
        color: '#cc0000',
        marginLeft: 15
    },

    viewStyleForLine1: {
        borderBottomWidth: 1,
        borderColor: '#cc0000',
        marginLeft: 5,
        alignItems:"center",      
        marginRight: 15,
        alignSelf:"center",
        flex:1
    },

What modification I should do?


Viewing all articles
Browse latest Browse all 28463

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>