//cocos2dx c++加载webview
cocos2d::experimental::ui::WebView* webview =cocos2d::experimental::ui::WebView::create();
webview->cocos2d::Node::setContentSize(Size(620,350));
// webview->loadURL("http://www.baidu.com"); //加载一个网页地址
webview->cocos2d::Node::setPosition(20,30);
webview->setScalesPageToFit(true);
// webview->loadHTMLString(Html); //加载html字符串代码
webview->setColor(Color3B(255,0,0));
webview->setAnchorPoint(Vec2(0,0));
this->addChild(webview);
设置webview背景透明
ios设置:
/cocos2d/cocos/ui/UIWebViewImpl-ios.mm
//源代码:
- (void)setupWebView {
if (!self.uiWebView) {
self.uiWebView = [[[UIWebView alloc] init] autorelease];
self.uiWebView.delegate = self;
}
if (!sel
cocos2d::experimental::ui::WebView* webview =cocos2d::experimental::ui::WebView::create();
webview->cocos2d::Node::setContentSize(Size(620,350));
// webview->loadURL("http://www.baidu.com"); //加载一个网页地址
webview->cocos2d::Node::setPosition(20,30);
webview->setScalesPageToFit(true);
// webview->loadHTMLString(Html); //加载html字符串代码
webview->setColor(Color3B(255,0,0));
webview->setAnchorPoint(Vec2(0,0));
this->addChild(webview);
设置webview背景透明
ios设置:
/cocos2d/cocos/ui/UIWebViewImpl-ios.mm
//源代码:
- (void)setupWebView {
if (!self.uiWebView) {
self.uiWebView = [[[UIWebView alloc] init] autorelease];
self.uiWebView.delegate = self;
}
if (!sel