我正在尝试从网址中显示一些HTML内容。我的问题是背景图像没有显示在WebView中。
我的网址是" http://localhost/clients/gdc4gpat.in/home/get_answers/431"
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
body{
background-image: url('http://localhost/clients/gdc4gpat.in/assets-site/images/gdc_bg1.png') !important;
background-repeat:no-repeat;
background-position:center top;
background-attachment:fixed;
}
.question{
padding: 5px 0px;
}
.option{
padding: 10px 0px;
}
.answer-div{
color:white;
padding: 10px 0px;
}
.answer, .correct{
font-weight: bold;
}
.bg-red{
background-color: red;
}
.bg-green{
background-color: green;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (2):</b></span><span style="color:#FF0000;"><strong>In non-flocculated suspension, the particle exists as</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><strong>Aggregation</strong></div>
<div class="option"><span>(B)</span><strong>Cake </strong></div>
<div class="option"><span>(C)</span><strong>Separate entities </strong></div>
<div class="option"><span>(D)</span><strong>Coalescence </strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : C</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : </span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (3):</b></span><span style="color:#FF0000;"><strong>Example of alcohol volatile oil</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><strong>Peppermint </strong></div>
<div class="option"><span>(B)</span><strong>Cinnamon</strong></div>
<div class="option"><span>(C)</span><strong>Lemon peel</strong></div>
<div class="option"><span>(D)</span><strong>Orange peel </strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : </span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (4):</b></span><span style="color:#FF0000;"><strong>Which of the following pairs of compound is used as solvents in UV spectroscopy</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><strong>Water, 95 % ethanol, Hexanal</strong></div>
<div class="option"><span>(B)</span><strong>Acetonitrile, Chloroform, 1,4 Dioxane</strong></div>
<div class="option"><span>(C)</span><strong>Methanol, Isooctane, Trimethylphosphate </strong></div>
<div class="option"><span>(D)</span><strong>All are correct </strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : D</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : B</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (5):</b></span><span style="color:#FF0000;"><strong>Lemon grass oil is obtained from</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><strong>Cymbopogan flexuousus</strong></div>
<div class="option"><span>(B)</span><strong>Pinus roxburghii </strong></div>
<div class="option"><span>(C)</span><strong>Cymbopogan nardus </strong></div>
<div class="option"><span>(D)</span><strong>Cymbopogan martini </strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (6):</b></span><span style="color:#FF0000;"><strong>The transition energy order in ultraviolet spectroscopy by organic molecules is </strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><strong>n</strong><strong>→</strong><strong>π*>π</strong><strong>→</strong><strong>π*>n</strong><strong>→</strong><strong>σ*>σ</strong><strong>→</strong><strong>σ*</strong></div>
<div class="option"><span>(B)</span><strong>n→</strong><strong>π*>π</strong><strong>→</strong><strong>π*> σ</strong><strong>→</strong><strong>σ*>n</strong><strong>→</strong><strong>σ*</strong></div>
<div class="option"><span>(C)</span><strong>σ</strong><strong>→</strong><strong>σ*>n</strong><strong>→</strong><strong>σ*> π</strong><strong>→</strong><strong>π*> n</strong><strong>→</strong><strong>π* </strong></div>
<div class="option"><span>(D)</span><strong>σ→</strong><strong>σ*>π</strong><strong>→</strong><strong>π*> n</strong><strong>→</strong><strong>σ*> n</strong><strong>→</strong><strong>π* </strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : C</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : B</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (7):</b></span><span style="color:#FF0000;"><strong>Which of the following is bronchodilators</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Corticosteroids</font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Salmeterol </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Ketotifen </font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">Sodium cromoglycate </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : B</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (8):</b></span><span style="color:#FF0000;"><strong>Drave test is associated with measuring the efficiency of </strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Detergent </font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Wetting agent </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Suspending agents </font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">Absorbent </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : B</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (9):</b></span><span style="color:#FF0000;"><strong>Artemisia annua comes under the class</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Sesquiterpenoids </font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Monoterpenoids </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Diterpenoids</font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">Tritepenoids </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (10):</b></span><p style="margin: 0cm 0cm 0pt;"><strong><span style="color:#FF0000;">Determine the correctness or otherwise of the following Assertion [a] and the Reason [r] –<br />
Assertion (a) : </span>Terpenoid are basically originated from Isoprene unit<br />
<span style="color:#FF0000;">Reason (r) :</span> Every Isoprene unit contain C5H8</strong></p>
</div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Both (a) and (r) are true, and (r) is a correct reason for (a)</font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria"> Both (a) and (r) are true, and (r) is NOT the correct reason for (a)</font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria"> (a) is true but (r) is false</font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria"> Both (a) and (r) are false </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : B</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : A</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (11):</b></span><strong><span style="color:#FF0000;">“Holy basil” is the synonym for drug</span></strong></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><i><b>Alpina officinarum</b></i><b> </b></div>
<div class="option"><span>(B)</span><b><i>Allium sativum</i></b></div>
<div class="option"><span>(C)</span><i><b>Nardostachys jatamonum</b></i><b> </b></div>
<div class="option"><span>(D)</span><i><b>Ocium sanctum</b></i><b> </b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : D</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (12):</b></span><span style="color:#FF0000;"><strong>Bioassays are carried out to</strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Measure the pharmacological activity of a drug </font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Avoid clinical trial for new drugs </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Detect the impurity in a given drug </font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">Screen for pharmacogenetic influence of new drugs </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : B</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (13):</b></span><p style="margin: 0cm 0cm 0pt;"><strong><span style="color:#FF0000;">Given are four statements about spectral analysis - </span><br />
[P] Bathochromic shift -The wavelength change to longer wavelength <br />
[Q] Hypsochromic shift - The wavelength change to shorter wavelength <br />
[R] Hyperchromic shift - The absorption intensity is decreased <br />
[S] Hypochromic shift - The absorption intensity is decreased <br />
Choose the correct combination of statements </strong></p>
</div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">P, Q & R are true while S is false </font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Q, R & S are true while P is false</font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">P, Q & S are true while R is false</font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">All are correct</font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : C</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : A</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (14):</b></span><span style="color:#FF0000;"><strong><span style="font-size: 12pt; font-family: "Cambria","serif";">Soap from divalent base produces ………….emulsion </span></strong></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">o/w</font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">w/o </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Both </font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">None </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : B</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (15):</b></span><p style="margin: 0cm 0cm 0pt;"><span style="color:#FF0000;"><strong><span style="font-size: 12pt; font-family: "Cambria","serif";">Myristicin chemically is</span></strong></span></p>
</div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><b><font face="Cambria">Methoxy safrole </font></b></div>
<div class="option"><span>(B)</span><b><font face="Cambria">Ethoxy safrole </font></b></div>
<div class="option"><span>(C)</span><b><font face="Cambria">Propyoxy saffrole </font></b></div>
<div class="option"><span>(D)</span><b><font face="Cambria">Dimethoxy saffrole </font></b></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-red">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : C</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (16):</b></span><span style="color:#FF0000;"><strong><span style="font-size: 12pt; font-family: "Cambria","serif";">Determine the correctness or otherwise of the following Assertion [a] and Reason [r] -</span></strong></span>
<p style="margin: 0cm 0cm 0pt;"><strong><span style="font-size:12.0pt;font-family:"Cambria","serif";
mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:
Mangal;mso-bidi-theme-font:minor-bidi"><span style="color:#FF0000;">Assertion [a] :</span><font color="#000000"> All pharmacokinetics processes involve transport of drug across biological </font></span></strong><strong><span style="font-size:12.0pt;font-family:"Cambria","serif";
mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:
Mangal;mso-bidi-theme-font:minor-bidi"><font color="#000000">membrane</font></span></strong></p>
<p style="margin: 0cm 0cm 0pt;"><strong><span style="font-size:12.0pt;font-family:"Cambria","serif";
mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin;mso-bidi-font-family:
Mangal;mso-bidi-theme-font:minor-bidi"><span style="color:#FF0000;">Reason [r] : </span><font color="#000000">Biological membrane is a bilayer of phospholipids and cholesterol</font></span></strong></p>
</div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="option"><span>(A)</span><span style="font-size:14px;"><b><font face="Cambria"> Both (a) and (r) are true but (r) is not the correct reason for (a)</font></b></span></div>
<div class="option"><span>(B)</span><span style="font-size:14px;"><b><font face="Cambria">Both (a) and (r) are true but (r) is the correct reason for (a)</font></b></span></div>
<div class="option"><span>(C)</span><span style="font-size:14px;"><b><font face="Cambria">Both (a) and (r) are false</font></b></span></div>
<div class="option"><span>(D)</span><span style="font-size:14px;"><b><font face="Cambria"> (a) is true but (r) is false</font></b></span></div>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12 answer-div bg-green">
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="correct">Correct Answer : A</span></div>
<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6"><span class="answer">Your Answer : A</span></div>
</div>
<div class="solution"></div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-12">
<div class="question"><span><b>Question (18):</b></span><span style="color:#FF0000;"><strong>Stomata present in Fennel</strong></span></div>
</div>
</div>
</body>
</html>
&#13;
web视图:
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:scrollbars="none"
android:hardwareAccelerated="false"/>
Android活动:
WebView webView=(WebView)findViewById(R.id.webview);
webView.setBackgroundColor(0);
webView.setBackgroundColor(Color.TRANSPARENT);
webView.setBackgroundResource(R.drawable.gdc_bg1);
webView.loadUrl(url);
答案 0 :(得分:0)
您需要将其更改为:
background-image: url('assets/image/gdc_bg1.png') !important;
因为仅在桌面上的手机上没有任何本地主机。所以你需要添加到您的资产文件夹。所以你可以从那里加载它。