как показать json вывод в формате html в реагировать родной - PullRequest
1 голос
/ 13 января 2020
"description": "<ul class=\" list-paddingleft-2\" style=\"outline: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; color: rgb(51, 51, 51); text-align: center; width: 1106.55px;\"><li style=\"outline: 0px; margin: 0px; padding: 0px; list-style: none outside none;\"><div style=\"\"><span style=\"outline: 0px; margin: 0px; padding: 0px; font-size: 14px; line-height: 16.1px;\"><p class=\"MsoNoSpacing\" style=\"text-align: left; \"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\">Mini USB cable is a stylish, sturdy and contemporary way of charging. It is made up of high grade material and offers faster charging &amp; data transfer. The enticing design of this USB is its USP. It is stylish, portable and can even be carried in pocket. The compact design of the Mini USB cable doesn’t acquire much space and doesn’t tangle like the common lengthy cables. This cable has rugged and sturdy build which offers faster charging and effortless data transfer. This product comes with replacement warranty. You can replace the product if you come across any manufacturing defects within the warranty period. Order this product today and carry it in your pocket for charging your Smartphone&nbsp;</span>anywhere anytime.&nbsp;<span style=\"font-family:&quot;Arial&quot;,&quot;sans-serif&quot;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-bottom: 3.95pt; text-align: justify; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><b><span lang=\"EN-IN\" style=\"font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;mso-fareast-font-family:&quot;Times New Roman&quot;;\r\ncolor:#C00000;mso-ansi-language:EN-IN\"><br><span style=\"font-size: 14px;\">\r\nOther features</span></span></b><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Soft grip</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Long life span</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Fast charging&nbsp;</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Portable &amp; affordable</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-bottom: 3.95pt; text-align: justify; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><b><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif; color: rgb(192, 0, 0);\"><br></span></b></p><p class=\"MsoNormal\" style=\"margin-bottom: 3.95pt; text-align: justify; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><b><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif; color: rgb(192, 0, 0); font-size: 14px;\">Technical Specifications</span></b><br></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Charging speed: 2A</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Length: 200mm</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size: 14px;\">\r\n\r\n</span><span style=\"font-size: 14px;\">\r\n\r\n</span><span style=\"font-size: 14px;\">\r\n\r\n</span><span style=\"font-size: 14px;\">\r\n</span><span style=\"font-size: 14px;\">\r\n</span><span style=\"font-size: 14px;\">\r\n</span><span style=\"font-size: 14px;\">\r\n</span><span style=\"font-size: 14px;\">\r\n\r\n</span><span style=\"font-size: 14px;\">\r\n\r\n</span></p><p class=\"MsoNormal\" style=\"margin: 0cm 0cm 3.95pt -18pt; text-align: justify; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;\"><span lang=\"EN-IN\" style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: 14px;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style=\"font-size: 14px;\">Connector type: Micro USB&nbsp;</span></span><span style=\"font-family: Arial, sans-serif;\"><o:p></o:p></span></p></span></div></li></ul>",

Это мой ответ json, и теперь я хочу показать этот ответ в своем родном приложении android, и я использовал пакеты, такие как html view и render html view, и сначала он показал, что он ошибка - "fontfamily" arial, sans-serif "не является системным шрифтом и не был загружен через font.loadasyn c в реагировать на", но при поиске я нашел решение, но после этой ошибки теперь его всплывающее окно не может добавить ребенок, у которого нет узла йоги к родителю без функции измерения!

как мне показать json ответ в html и показать на родной странице, а в ответе у него есть изображения, как это сделать это я застрял?

это мой код

<Text>
 <HTML html={this.state.data.description} imagesMaxWidth={Dimensions.get('window').width} ignoredStyles={["font-family", "letter-spacing"]}/>
  </Text>

1 Ответ

0 голосов
/ 13 января 2020

Вы можете использовать: Reaction-native-render- html

...