【问题标题】:'react-native-mathjax' height auto adjust not working'react-native-mathjax' 高度自动调整不起作用
【发布时间】:2021-01-18 06:15:35
【问题描述】:

我正在使用 react-native-mathjax 在我的 react 本机应用程序中渲染数学方程式,但是当我转到下一个查询时,react-native-mathjax library 中的 webview 的自动调整高度不起作用。 react-native-mathjax 采用之前的高度来呈现下一个查询。如何在我的应用中调整视图高度?

 import React from 'react';
 import { View, Text } from 'react-native';
 import MathJax from 'react-native-mathjax';

 function Test() {
     return (
              <View>
                  <MathJax
                        html={<p><span class="math-tex">\(\begin{bmatrix} 2 &1 \\[0.3em] 3&4\\[0.3em] \end{bmatrix}\)</span></p>} 
                  />
              </View>
            );
 }
 export default Test;

【问题讨论】:

  • 能否提供相关代码?
  • @koder613 我正在使用react-native-mathjax 中提供的代码来呈现我的查询。
  • @koder613 我正在使用link 库来呈现我的查询。

标签: react-native mathjax react-native-webview


【解决方案1】:

react-native-mathjax 中使用react-native-autoheight-webview 而不是react-native-webview。当您移动到下一个查询时,它会自动调整 webview 的高度。

npm install react-native-autoheight-webview

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多