2017-01-06 6 views
0

Ich möchte ein paar Bilder in meiner Android-Anwendung hinzufügen. HierBild nicht sichtbar im Gerät aber im Layout sichtbar Android

ist das XML-Code-

<?xml version="1.0" encoding="utf-8"?> 
<android.widget.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_launcher" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/colorPrimaryDark" 
tools:context="com.example.rishabhgambhir.findthelost.Launcher"> 

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:srcCompat="@mipmap/logo21" 
    android:id="@+id/mainlogo" 
    android:contentDescription="main logo" 
    tools:layout_constraintBottom_creator="1" 
    app:layout_constraintBottom_toTopOf="@+id/imageView2" 
    tools:layout_constraintLeft_creator="1" 
    app:layout_constraintLeft_toLeftOf="@+id/imageView2" 
    android:layout_above="@+id/imageView2" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginLeft="84dp" 
    android:layout_marginStart="84dp" 
    android:layout_marginBottom="113dp" /> 

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:srcCompat="@mipmap/transparent_text_effect" 
    android:id="@+id/imageView2" 
    tools:layout_constraintRight_creator="1" 
    tools:layout_constraintBottom_creator="1" 
    app:layout_constraintBottom_toBottomOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    android:layout_marginBottom="85dp" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" /> 
</android.widget.RelativeLayout> 

Was hier vielleicht falsch ist?

+0

ja post voller code! –

Antwort

1

Sie können eine Zeile zu Bildansicht xml hinzufügen.

<ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@mipmap/ic_launcher" 
     android:id="@+id/mainlogo" 
     android:contentDescription="main logo" 
     tools:layout_constraintBottom_creator="1" 
     app:layout_constraintBottom_toTopOf="@+id/imageView2" 
     tools:layout_constraintLeft_creator="1" 
     app:layout_constraintLeft_toLeftOf="@+id/imageView2" 
     android:layout_above="@+id/imageView2" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_marginLeft="84dp" 
     android:layout_marginStart="84dp" 
     android:layout_marginBottom="113dp" /> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@mipmap/ic_launcher" 
     android:id="@+id/imageView2" 
     tools:layout_constraintRight_creator="1" 
     tools:layout_constraintBottom_creator="1" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     android:layout_marginBottom="85dp" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" /> 
Verwandte Themen