2016-07-04 2 views
1

webview에서 일부 페이지를 여는 Android 앱이 있습니다.Android webview가 twitter 페이지를 제대로 열지 못합니다.

screenshot of the page을 볼 수 있습니다. 에 트위터가 머리글을 볼 수있는 것을 볼 수 없습니다.

모든 웹보기 설정을 시도했지만 제대로 작동하지 않습니다. 당신은 layout_width 설정해야합니다

I/chromium: [INFO:CONSOLE(0)] "Refused to load the image 'https://www.google.com.tr/ads/ga-audiences?v=1&aip=1&t=sr&_r=4&tid=UA-30775-67&cid=1855674525.1467776671&jid=2048800659&_v=j44&z=267031279&ipr=y' because it violates the following Content Security Policy directive: "img-src 'self' 'unsafe-inline' blob: data: https://*.cdn.twitter.com https://ton.twitter.com https://*.twimg.com https://stats.g.doubleclick.net https://www.google.com https://www.google-analytics.com https://www.periscope.tv". 
      ", source: https://mobile.twitter.com/home (0) 
+0

전체 로그를 게시하십시오. –

+1

이 링크를 확인하십시오. http : //stackoverflow.com/questions/6856814/problems-loading-mobile-twitter-in-webview – prakash

+0

예. 이미 prakask를 확인했습니다. 하지만 로그를 확인했습니다. 분명한 문제는 없습니다. 내 앱의 문제는 https://play.google.com/store/apps/details?id=tr.com.socialmedia 주소에서 확인할 수 있습니다. 이것은 단지 twp 주 전에 새로운 것이 었습니다. 하지만 나는 webview 4.4 이후에 작동하지 않는 것을 바꾸지 않았다. – mtuygun

답변

2

와 layout_height는 다음과 같은 속성 :

webview.getSettings().setJavaScriptEnabled(true); 
webview.setWebViewClient(new MyWebViewClient()); 
webview.setWebChromeClient(new MyWebChromeClient); 
webview.getSettings().setDefaultTextEncodingName("utf-8"); 
webview.getSettings().setPluginState(PluginState.ON); 
webview.getSettings().setBuiltInZoomControls(true); 
webview.getSettings().setDisplayZoomControls(false); 
webview.getSettings().setUseWideViewPort(true); 
webview.getSettings().setLoadWithOverviewMode(true); 
webview.getSettings().setDomStorageEnabled(true); 
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 
webview.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH); 
webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 

[편집] 나는 아래 콘솔에서 오류가 발생하고있다.

android:layout_width="match_parent" 
android:layout_height="match_parent" 
관련 문제