【问题标题】:html iframe display and control in flutterhtml iframe在flutter中的显示和控制
【发布时间】:2019-03-29 16:41:48
【问题描述】:

当我有包含文本、图像和 iframe 的 HTML 内容时,我知道我可以使用 flutter_html 包或其他类似包显示 HTML,但直到现在它们都不支持 iframe...我前往显示的 webview 包整个 HTML 内容,但我无法控制内容的大小或方向内容和文字方向? 在此先感谢

image of the current text direction demonstrating my issue

"<p>موجز الأخبار ليوم الأربعاء 27-3-2019:</p><p>&nbsp;</p><p><iframe src=\"https://www.youtube.com/embed/qvW_wqCMkKQ\" width=\"400\" height=\"300\" frameborder=\"0\"></iframe></p>"

【问题讨论】:

    标签: dart flutter


    【解决方案1】:

    我不确定你在问什么。但我选择的是你希望能够控制 WebView 的尺寸。

    如果是这种情况,您可以使用Container() 类。即将 Webview 小部件包装为容器的子级

      Container(
        margin: const EdgeInsets.all(10.0), //set the margin for the container
        width: 48.0, // width
        height: 48.0, //height
        child: YourWebViewComponent()
    
      )
    

    如果那是你想要的,请告诉我。

    【讨论】:

    • 我想控制网页视图中 Html 内容的文本方向,并将其更改为从右到左而不是从左到右
    • 我添加了一张照片来证明这个问题
    【解决方案2】:

    经过大量搜索后,我决定尝试自行更改 HTML。所以我将此标签添加到现有的 HTML 中-注意,我在搜索后添加了它,我之前从未处理过 HTML,不知道他们称之为这些添加,所以我将其命名为标签-

    "<font size='$textsize'face='Cairo'dir='rtl'><p>موجز الأخبار ليوم الأربعاء 27-3-2019:</p><p>&nbsp;</p><p><iframe          src=\"https://www.youtube.com/embed/qvW_wqCMkKQ\"   width=\"400\" height=\"300\" frameborder=\"0\"></iframe></p></font>"
    

    希望它对将来的某些人有所帮助:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-04
      • 1970-01-01
      • 2015-05-04
      • 1970-01-01
      • 2021-07-28
      • 1970-01-01
      • 2019-04-09
      • 1970-01-01
      相关资源
      最近更新 更多