ButtonView does not display correctly

0

In android studio I just inserted a ButtonView in a Relative layout. Although in the preview it looks good, when giving the play comes compressed:

code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context="com.xxx.xxx.xxx"
    android:orientation="vertical"
    android:weightSum="1"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    >

    <WebView
        android:id="@+id/webV"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

    </WebView>

    <ImageButton
        android:id="@+id/imageButton7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@mipmap/ic_engranaje" />
</RelativeLayout>
    
asked by pepito 16.07.2017 в 13:04
source

1 answer

1

The problem I think you're having when loading the button image, which is not loading.

Try changing app:srcCompat="@mipmap/ic_engranaje" by android:src="@mipmap/ic_engranaje"

You can take a look at this question from OS in English explaining the difference in using app:srcCompat vs android:src that basically resides in that the one you are using is used to insert vector drawings while the one I suggest is used to insert a drawable.

    
answered by 20.07.2017 / 10:34
source