2012-04-26 18 views
0
<base href="http://www.myurl.com/"> 
     <link href="templates/default/css/mycss.css?1" rel="stylesheet" type="text/css" /> 

andrid webviewでURLをロードしようとしています。ページはロードされていますが、CSSはありません。相対パスのための方法があります。キャッシュを使わずに直接CSSを使ってページをロードし、それをloadDataWithBaseURLで開く方法はありますか? advamceWebview、スタイルシート相対パスint url

答えて

0

おかげで...

Description = (WebView)findViewById(R.id.webView1); 
    Description.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); 
    Description.getSettings().setJavaScriptEnabled(true); 
    Description.getSettings().setBuiltInZoomControls(true); 
    //PodcastDescription.setTextSize(20.f); 
    //PodcastDescription.setTypeface(tf); 

    Bundle mybundle = getIntent().getExtras(); 
    Integer NewsNumber = mybundle.getInt("number"); 


    String CurrentDescription = Entertainment.Description[NewsNumber]; 




    Description.loadDataWithBaseURL (null, "<html><head><style>@font-face{font-family:'MeeraRegular'; src: url('file:///android_asset/fonts/Meera.ttf');}body{font-family:'MeeraRegular'; font-size:20px; } </style></head><body>"+CurrentDescription+"</body></html>", "text/html", "UTF-8", 
    null); 
+0

これを試してみてください、私はCurrentDescriptionを得るためにページ全体をキャッシュする必要があります。私はそれを避けたい – Blackbelt