2016-12-11 5 views
-1

Пожалуйста, кто-нибудь скажет мне, что не так с моим ImageView?ImageView не отображается на устройстве

Вот мой макет XML

<?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:id="@+id/activity_login" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="elektrasoft.com.ridehubdriver.LoginActivity" 
    android:background="@color/colorPrimary" 
    android:padding="20dp"> 

    <ImageView 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     app:srcCompat="@mipmap/ic_launcher" 
     android:id="@+id/logoImageView" 
     android:layout_centerHorizontal="true" /> 

    <TextView 
     android:text="here is some text " 
     android:textColor="#ffffff" 
     android:textSize="20dp" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/logoImageView" 
     android:layout_centerHorizontal="true" 
     android:id="@+id/textView" 
     android:layout_marginBottom="20dp" /> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textEmailAddress" 
     android:ems="10" 
     android:background="@drawable/input_background" 
     android:id="@+id/emailEditText" 
     android:hint="Email ..." 
     android:padding="15dp" 
     android:layout_below="@+id/textView" 
     android:layout_alignParentStart="true" 
     android:layout_marginTop="20dp" /> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textPassword" 
     android:ems="10" 
     android:background="@drawable/input_background" 
     android:id="@+id/passswordEditText" 
     android:hint="Password ..." 
     android:padding="15dp" 
     android:layout_marginTop="10dp" 
     android:layout_below="@+id/emailEditText" 
     android:layout_alignParentStart="true" /> 

    <Button 
     android:text="Sign In" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/passswordEditText" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="30dp" 
     android:textSize="20dp" 
     android:textColor="@color/colorPrimary" 
     android:background="@drawable/button_background" 
     android:id="@+id/loginBtn" /> 


    <Button 
     android:text="Sign up" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/button_background" 
     android:id="@+id/signupBtn" 
     android:textSize="20dp" 
     android:textColor="@color/colorPrimary" 
     android:layout_marginTop="10dp" 
     android:layout_below="@+id/loginBtn" 
     android:layout_alignParentStart="true" /> 


</RelativeLayout> 

здесь изображение показывается в Android Studio enter image description here

и вот это изображение, показывающее на устройстве "Galaxy S6"

enter image description here

+1

@Rotwang Спасибо братан, его работы :) –

+0

я преобразовал свой комментарий к ответу, так что вы можете принять его и удалить эту запись из очереди Вопрос без ответа. –

ответ

1

Изменение от

app:srcCompat="@mipmap/ic_launcher" 

в

android:src="@mipmap/ic_launcher" 
Смежные вопросы