2017-04-25 16 views
1

これは、すべてがプレースホルダの背景でうまく動作している最初のスクリーンショットです。ImageViewのsrcを変更した後、ConstraintLayoutが壊れる

enter image description here

これは2 ImageButtonsはもう表示されない第二のスクリーンショットです。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 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.bruisedbanana.squareshift.MainActivity"> 

    <ImageView 
     android:scaleType="centerCrop" 
     android:src="@drawable/squareshiftbackground" 
     android:id="@+id/imageView2" 
     app:layout_constraintTop_toTopOf="parent" 
     android:layout_marginTop="8dp" 
     app:layout_constraintBottom_toBottomOf="parent" 
     android:layout_marginBottom="8dp" 
     android:layout_marginRight="8dp" 
     app:layout_constraintRight_toRightOf="parent" 
     android:layout_marginLeft="8dp" 
     app:layout_constraintLeft_toLeftOf="parent" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_centerHorizontal="true" 
     android:layout_centerVertical="true" 
     android:adjustViewBounds="true" 
     /> 
    <ImageButton 
     android:id="@+id/buttonPlay" 
     android:background="@drawable/buttonPlay" 
     android:layout_width="95dp" 
     android:layout_height="45dp" 
     android:layout_marginRight="8dp" 
     app:layout_constraintRight_toRightOf="parent" 
     android:layout_marginLeft="8dp" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintTop_toTopOf="parent" 
     android:layout_marginTop="8dp" 
     app:layout_constraintHorizontal_bias="0.502" 
     android:layout_marginBottom="8dp" 
     app:layout_constraintVertical_bias="0.952" 

     app:layout_constraintBottom_toTopOf="@+id/buttonExit" /> 
    <ImageButton 
     android:id="@+id/buttonExit" 
     android:background="@drawable/buttonExit" 
     android:layout_width="95dp" 
     android:layout_height="45dp" 
     android:layout_marginRight="8dp" 
     app:layout_constraintRight_toRightOf="parent" 
     android:layout_marginLeft="8dp" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintTop_toTopOf="@+id/imageView2" 
     android:layout_marginTop="8dp" 
     app:layout_constraintHorizontal_bias="0.502" 
     app:layout_constraintBottom_toBottomOf="parent" 
     android:layout_marginBottom="8dp" 
     app:layout_constraintVertical_bias="0.891" /> 

</android.support.constraint.ConstraintLayout> 

私は/描画可能squareshiftbackground @からSRCを変えてやっているすべての@に描画可能/ realbackground:

enter image description here

は参考のために、ここに私のテストXMLです。誰も助けることができますか?

答えて

0

ImageViewソースを変更した後で、イメージブーンにYourImageButton.bringToFront()を試すことができます。

関連する問題