2014-03-27 2 views
0

adjustViewBounds = "true"인 ImageView가 있고 다른 뷰를 정렬해야하는 상황에 처한 사람이 있습니까? 제 레이아웃이 예기치 않게 작동합니다 :AdjustViewBounds = "true"인 ImageView와 뷰 정렬이 작동하지 않습니다.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"> 

    <ImageView 
    android:id="@+id/thumb" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scaleType="centerInside" 
    android:src="@drawable/thumbnail" 
    android:layout_centerInParent="true" 
    android:adjustViewBounds="true"/> 

    <LinearLayout 
     android:id="@+id/selection" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_alignTop="@id/thumb" 
     android:layout_alignBottom="@id/thumb"> 

    </LinearLayout> 
</RelativeLayout> 

정렬하는 것을 권장하지 않는 것이 좋습니다.

답변

0

RelativeLayout 너비와 높이가 match_parent로 변경되어 작동합니다. 그런데 ImageView의 크기가 제한되면 가운데 정렬 할 점은 무엇입니까? 그것은 이해하지 못합니다. 목표는 무엇입니까? 와이어 프레임을 게시 할 수 있습니까?

관련 문제