Search code examples
androidandroid-studiographicsandroid-relativelayout

Image does not appear in Relative Layout of Android Studio


When inserting two images into Android Studio's Relative Layout, as shown in the photo below, you can see that images have been inserted into DrawableBottom, Foreground, and Icon:

enter image description here

But when running the same graphical interface on the mobile, the images do not appear. Please, what to do for the images to appear? It's in the Relative Layout of Android Studio.

enter image description here


Solution

  • For your case I think should do this to show android:background:"@drawable/seta_direita"

    Button:

    <Button
           android:id="@+id/btn"
           android:layout_width="24dp"
           android:layout_height="24dp"
           android:background="@drawable/seta_direita"/>
    

    RelativeLayout:

     <RelativeLayout
               android:id="@+id/layout"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:background="@drawable/seta_direita">
     </RelativeLayout>