File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
cocos/platform/android/java/src/org/cocos2dx/lib Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -127,23 +127,15 @@ public void run() {
127
127
}
128
128
129
129
public static void setBackgroundTransparent (final int index ) {
130
- if (android .os .Build .VERSION .SDK_INT >10 ) {
131
- sCocos2dxActivity .runOnUiThread (new Runnable () {
132
- @ Override
133
- public void run () {
134
- Cocos2dxWebView webView = webViews .get (index );
135
- if (webView != null ) {
136
- webView .setBackgroundColor (Color .TRANSPARENT );
137
- try {
138
- Method method = webView .getClass ().getMethod ("setLayerType" ,int .class ,Paint .class );
139
- method .invoke (webView ,WebView .LAYER_TYPE_SOFTWARE ,null );
140
- } catch (Exception e ) {
141
- e .printStackTrace ();
142
- }
143
- }
130
+ sCocos2dxActivity .runOnUiThread (new Runnable () {
131
+ @ Override
132
+ public void run () {
133
+ Cocos2dxWebView webView = webViews .get (index );
134
+ if (webView != null ) {
135
+ webView .setBackgroundColor (Color .TRANSPARENT );
144
136
}
145
- });
146
- }
137
+ }
138
+ });
147
139
}
148
140
149
141
public static void setOpacityWebView (final int index , final float opacity ) {
You can’t perform that action at this time.
0 commit comments