Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-native icon inline with text

Hi I want achieve the following style:

enter image description here

But with the following code i get a the icon in separate column and the text in another

<View style={{flex:1, flexDirection:'row'}}>
  <Icon height={10} width={10} />
  <Text>It is a long established fact that a reader will be distracted by the readable 
    content of a page when looking at its layout. The point of using Lorem Ipsum is that it 
    has a more-or-less normal distribution of letters, as opposed to using 'Content here, 
    content here'
</Text>
</View>

enter image description here

please ignore the different icons. Any solution to this problem?

like image 692
Dibakar Halder Avatar asked Oct 22 '25 03:10

Dibakar Halder


1 Answers

actually, you can embed the icon within the text, like this:

<View style={{flex:1, flexDirection:'row'}}>
  <Text>
    <Icon height={10} width={10} />
    It is a long established fact that a reader will be distracted by the readable 
    content of a page when looking at its layout. The point of using Lorem Ipsum is that it 
    has a more-or-less normal distribution of letters, as opposed to using 
    'Content here, content here'
  </Text>
</View>
like image 115
kenmistry Avatar answered Oct 23 '25 18:10

kenmistry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!