1
votes

I searched a ton in the internet on how to make my background image full on my android app and apparently it's still smaller. I was hoping if you guys know any solution for this?

Most of the image I've uploaded is on the @mipmap folder and apparently I can't find a way to insert an image in @drawable folder. I tried opening the drawable folder and copy paste a picture to put it inside but when it ran it came across a couple of errors.

Error:(12, 25) No resource found that matches the given name (at 'background' with value '@drawable/images').

This a picture of is how it looks like

I've also attached my content xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_sad"
    tools:context="com.example.chadymaebarinan.emojiexpress.Sad">

    <ImageView
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:src="@mipmap/ic_launchersad"
        android:gravity="center"
        android:id="@+id/imageView"
        android:scaleType="fitXY"
        android:layout_marginTop="43dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="''I am SAD''"
        android:textColor="#FFFF00"
        android:textSize="50dp"
        android:textStyle="bold"
        android:gravity="center"
        android:id="@+id/textView4"
        android:layout_below="@+id/imageView"
        android:layout_alignParentStart="true" />

    <ImageButton
        android:layout_width="111dp"
        android:layout_height="111dp"
        android:src="@mipmap/ic_launcherspeak"
        android:background="@null"
        android:scaleType="fitXY"
        android:id="@+id/imageButton"
        android:layout_below="@+id/textView4"
        android:layout_centerHorizontal="true" />

    <ImageButton android:id="@+id/back"
        android:layout_width="111dp"
        android:layout_height="111dp"
        android:src="@mipmap/ic_launcherback"
        android:background="@null"
        android:scaleType="fitXY"
        android:layout_below="@+id/imageButton"
        android:layout_alignStart="@+id/imageButton" />
</RelativeLayout>

and here is my activity xml file:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true"
    tools:context="com.example.chadymaebarinan.emojiexpress.Sad"
    android:background="@drawable/ic_launcherimage">

    <android.support.design.widget.AppBarLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:theme="@style/AppTheme.AppBarOverlay">

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_sad" />
</android.support.design.widget.CoordinatorLayout>
3
mipmap is only for the app icon. Nothing else should go there.Phantômaxx
@FrankN.Stein Ohh I understand. I just don't know why, when I use drawable it always gives me an error after I ran itChuddyWagogo

3 Answers

3
votes

Put this into drawable folder instead of mipmap . The mipmap folders are for placing your app icons in only.

  1. Drawable folders in res folder?
0
votes

The image you want to add into your project just copy that and then right click on the drawable folder and press paste. I know you said you couldn't do it but that's how it works for me.

Once it is in the drawable folder you can set it as the background of your parent layout ie LinearLayout etc.

The mipmap is just for icons :)

-1
votes

put the my content.xml file into drawable folder and use it .