cocos2dx之WebView

转自 http://blog.sina.com.cn/s/blog_923fdd9b0102vdd9.html


#include "ui/CocosGUI.h"
 
using namespace cocos2d::experimental::ui;
WebView *webView = WebView::create();
    webView->setPosition(Vec2(visibleSize.width*0.5, visibleSize.height*0.5));
    webView->setContentSize(visibleSize);
    webView->loadURL("http://www.baidu.com");
    webView->setScalesPageToFit(true);
    webView->setOnShouldStartLoading([](WebView *sender, const std::string &url){
        
        return true;
    });
    webView->setOnDidFinishLoading([](WebView *sender, const std::string &url){
    
    });
    webView->setOnDidFailLoading([](WebView *sender, const std::string &url){
    
    });
    this->addChild(webView);


你可能感兴趣的:(cocos2dx之WebView)