【问题标题】:I can't customize the highlight color in epubjs-rn我无法在 epubjs-rn 中自定义突出显示颜色
【发布时间】:2020-01-04 06:59:45
【问题描述】:

我正在使用 epubjs-rn,我想选择一种颜色来突出显示文本。

我在文档中搜索并找到了这段代码,但它不起作用。

onSelected={(cfiRange, rendition) => {
  rendition.highlight(cfiRange, {}, (e) => {console.log(e)}, undefined, {fill: 'blue'});
}}

任何帮助将不胜感激。

【问题讨论】:

    标签: javascript react-native epub.js


    【解决方案1】:

    你应该使用这样的填充参数,这样可以正常工作:)

    rendition.highlight(mcfi, {}, (e) => { console.log(e) }, undefined, { 'fill': 'gold' });
    

    【讨论】:

    • 感谢 Meisam,这个问题迫使我向 epubjs-rn 发送拉取请求,这解决了问题 :)
    【解决方案2】:

    我认为,您应该设置“背景:蓝色”而不是填充:蓝色

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-21
      • 2011-04-10
      • 1970-01-01
      相关资源
      最近更新 更多