2017-01-06 2 views
0

Android 애플리케이션에 이미지를 몇 개 추가하고 싶습니다. 여기 이미지가 기기에는 표시되지 않지만 레이아웃에서는 표시됩니다. Android

여기에서 가능성이 잘못 무엇

<?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> 

코드 코드는 XML인가?

+0

예 전체 코드 게시! –

답변

1

이미지보기 XML에 한 줄을 추가 할 수 있습니다.

<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" /> 
관련 문제