Webview doesn't hide

Webview doesn't hide
0.0 0

#1

Hi,

I have a pageview, in which there is a layout and in that i have a webview.

I have a button and when i click on a button in a scene, i want to hide the pageview but when i run this code in button click -

pageView->setVisible(false);

it hides the pageview but webview doesn’t hide with it. It is still on the screen.

Even whn i run

_webView->setVisible(false);
_layout1->setVisible(false);

it doesn’t hide webview, but the layout is hidden…

What is the issue here…


#2

too late? :stuck_out_tongue:


#3

hehehehe…nope…:grinning: Thanks.


#4

Hi,

I added the methods as you mentioned in github. It works on ios but while building for android it gives errors, i am using cocos3.8.1 -

/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp: In member function 'void cocos2d::experimental::ui::WebViewImpl::setOpacityWebView(float)':
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:462:17: error: 'callStaticVoidMethod' is not a member of 'cocos2d::JniHelper'
                 JniHelper::callStaticVoidMethod(className, "setOpacityWebView", _viewTag, opacity);
                 ^
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:462:49: error: 'className' was not declared in this scope
                 JniHelper::callStaticVoidMethod(className, "setOpacityWebView", _viewTag, opacity);
                                                 ^
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp: In member function 'float cocos2d::experimental::ui::WebViewImpl::getOpacityWebView() const':
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:467:24: error: 'callStaticFloatMethod' is not a member of 'cocos2d::JniHelper'
                 return JniHelper::callStaticFloatMethod(className, "getOpacityWebView", _viewTag);
                        ^
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:467:57: error: 'className' was not declared in this scope
                 return JniHelper::callStaticFloatMethod(className, "getOpacityWebView", _viewTag);
                                                         ^
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp: In member function 'void cocos2d::experimental::ui::WebViewImpl::setBackgroundTransparent()':
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:471:17: error: 'callStaticVoidMethod' is not a member of 'cocos2d::JniHelper'
                 JniHelper::callStaticVoidMethod(className, "setBackgroundTransparent", _viewTag);
                 ^
/Users/mihirt/Desktop/DailyGood/cocos2d/cocos/ui/UIWebViewImpl-android.cpp:471:49: error: 'className' was not declared in this scope
                 JniHelper::callStaticVoidMethod(className, "setBackgroundTransparent", _viewTag);
                                                 ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-extern-c-compat"
cc1plus: warning: unrecognized command line option "-Wno-extern-c-compat"
make: *** [obj/local/armeabi/objs-debug/cocos_ui_static/UIWebViewImpl-android.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/Users/mihirt/Desktop/DailyGood/proj.android'

What changes do i have to make to make it compatible with cocos 3.8.1?