Show a website inside an ionic tab

前端 未结 2 1533
醉梦人生
醉梦人生 2020-12-11 01:35

I am working on an ionic framework based mobile application (mainly targeted for Android). My project is a tab based application. In the first tab I want to load an external

2条回答
  •  情话喂你
    2020-12-11 01:56

    I managed to solve it using iFrame.

    Using ajax .load() have problems like loading metadata. To use iFrame, you should add . Also, you should change your Android MainActivity on Create like this (I can't find source source: iframe for Android apps using Phonegap not working):

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.init();
        super.appView.setWebViewClient(new CordovaWebViewClient(this, super.appView) {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }
        });
        // Set by  in config.xml
        loadUrl(launchUrl);
    }
    

提交回复
热议问题