search

Home  >  Q&A  >  body text

weex - android关于加载sd卡下js问题,不是assets?

我加载SD卡下的某一个weex的js成功,但是切换不到该js同一目录的js,我该怎么写这个要切换的js的路径?求助。。。我已经试过标准的SD卡路径和file的URI路径,都不行,android

大家讲道理大家讲道理2767 days ago505

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-18 09:21:32

    It’s not a problem with the path. If you load a local file and pass the path, the default execution will be as follows:

        if (uri != null && TextUtils.equals(uri.getScheme(), "file")) {
          render(pageName, WXFileUtils.loadAsset(assembleFilePath(uri), mContext), renderOptions, jsonInitData, flag);
          return;
        }

    will load the assets,所以不要使用WXSDKInstancerenderByUrl方法,而使用render method, just pass the content of the file you want to load directly.

    reply
    0
  • Cancelreply