• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lcl22hope
V2EX  ›  程序员

请问 ios 上多看,ibook 这种 app,是如何修改阅读时的背景颜色的呢?应该不是改了某个 view 的 backgroundColor 吧?

  •  
  •   lcl22hope · Aug 17, 2014 · 5844 views
    This topic created in 4467 days ago, the information mentioned may be changed or developed.
    5 replies  •  2014-08-19 23:46:49 +08:00
    lcl22hope
    lcl22hope
    OP
    Aug 18, 2014
    1
    自问自答,原来不是要更改webview的背景色,它只是一个载体,加载文档的颜色来源于html文档本身,因此要想改变颜色,有两种方式1.修改html文档渲染颜色,也就是修改css,然后用javascript在加载document之前调用,2.比较简单的方式,仍然是设置webview的背景色,但是要将webview的opaque属性设置为NO,也就是透明,就可以了
    joeytat
    joeytat
    Aug 18, 2014
    2
    我脚着 iBook 肯定不是用 webView 写的
    lcl22hope
    lcl22hope
    OP
    Aug 19, 2014
    3
    @joeytat 那你觉得是什么控件?
    joeytat
    joeytat
    Aug 19, 2014
    4
    @lcl22hope CoreText
    Azone
    Azone
    Aug 19, 2014
    5
    WebView性能有影响,加载的也很慢,应该是用CoreText
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2347 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:19 · PVG 21:19 · LAX 05:19 · JFK 08:19
    ♥ Do have faith in what you're doing.