react-native-htmlview icon indicating copy to clipboard operation
react-native-htmlview copied to clipboard

Can not change Text direction

Open SiSa68 opened this issue 6 years ago • 2 comments

I want to have a <p> node with justified and rtl direction, but I can't achieve that

react-native: 0.60.4 Node: 10.15.3 - C:\Program Files\nodejs\node.EXE Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

What I tried:

  • setting direction: 'rtl' to the <p> node and <body> node
  • setting textAlign: 'right' to <body> node (when I set <body> it also remove all the content break line and ignore child style too!)
  • setting textComponentProps={{ style: {textAlign: 'right',} }}

Here is sample content: <body><div>hello</div><p>Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.</p></body>

And this is stylesheet:

StyleSheet.create({
 body: {
   direction: 'rtl',
   textAlign: 'right'
 },
div: {
   textAlign: 'center',
   marginBottom: 20
},
p: {
    textAlign: 'justify'
 },
});

SiSa68 avatar Aug 05 '19 15:08 SiSa68

I have the same problem in IOS. Can anyone solved this?

Taher62 avatar Dec 27 '19 10:12 Taher62

p: { textAlign:'left', },

timorss avatar May 04 '21 12:05 timorss