Question

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?

Was it helpful?

Solution

Yes just map different layers into different Layout containers?

Its simple:

<RelativeLayout>

    <--Layer one-->
          <RelativeLayout>
               <--Layer two>

                        <RelativeLayout>
                             <--Layer three-->
                        </RelativeLayout/>


          <RelativeLayout/>


    <RelativeLayout/>

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top