wzf
V2EX  ›  Android

android 手机获取 webview 的完整视图

  •  
  •   wzf · Mar 11, 2016 · 13374 views
    This topic created in 3740 days ago, the information mentioned may be changed or developed.

    怎样才能获取 webview 的完整视图?
    snapShot= webView.capturePicture();
    capture = Bitmap.createBitmap(snapShot.getWidth(),snapShot.getHeight(), Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(capture);
    上面的代码在其他手机上可以实现,但是在小米手机上只能获取第一屏的图像

    1 replies    2016-03-11 17:59:25 +08:00
    em70
        1
    em70  
       Mar 11, 2016 via iPhone
    之前项目也需要这个功能,也是卡兼容性这里了,最后用服务器端截图解决的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1606 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 16:15 · PVG 00:15 · LAX 09:15 · JFK 12:15
    ♥ Do have faith in what you're doing.