Reputation: 5167
I am implementing an ImageView which has the following effect: The background is an image to be loaded from an url and there is text on the image. Also there is a shadow behind the text. That is to say, there are three layers on the ImageView. Is there a concept of layer in ImageView which could make the rendering easier?
Upvotes: 0
Views: 1170
Reputation: 1431
here is your answer
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- FOR SHADOW EFFECT -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<!-- FOR IMAGE FROM URL -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<!-- FOR TEXT OVER IMAGE -->
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</RelativeLayout>
Upvotes: 0
Reputation: 7860
Yes just map different layers into different Layout containers?
Its simple:
<RelativeLayout>
<--Layer one-->
<RelativeLayout>
<--Layer two>
<RelativeLayout>
<--Layer three-->
</RelativeLayout/>
<RelativeLayout/>
<RelativeLayout/>
Upvotes: 1