Saturday, September 14, 2013

The transparent background imageview makes the normally opaque text that comes on it transparent too. How do I fix this?

The transparent background imageview makes the normally opaque text that
comes on it transparent too. How do I fix this?

What i want is an opaque text on a transparent background imageview.
Without the image the webview text is opaque and text that isnt on the the
background imageview is still opaque. I have searched but couldnt find a
solution for this.
here is my xml layout
'

<ScrollView
android:id="@+id/SCROLLER_ID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fillViewport="true">
<WebView
android:id="@+id/tvAnimalJoke"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
/>
</ScrollView>
<ImageView
android:id="@+id/ivAwesome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/awesome50jp"
/>
</RelativeLayout>
'
and here is my webview in java ' Random r = new Random();
number = r.nextInt(9851);
String randomjoke = getStreamTextByLine("9851.txt", number);
String numstr = Integer.toString(number);
String head = "<head><style>@font-face {font-family: 'verdana';src:
url('file:///android_asset/annoyingkettle.ttf');}body {font-family:
'verdana';}</style></head>";
String htmlData = "<html>" + head + numstr + "<body>" + "<p
align=\"justify\">"
+ randomjoke + "</p>" + "</body></html>";
Mywebview.loadDataWithBaseURL(null, htmlData, "text/html", "utf-8",
"about:blank");
' Here is an image of what im talking about

No comments:

Post a Comment