필자는 일정한 한계 이상으로 늘어나지 않는 수직 선형 레이아웃을 가지고 있습니다. LinearLayout의 최대 높이가 있습니까?
이
이 더 작물 세트 레이아웃 인 이미지 뷰 http://tinypic.com/r/20nm6s/5에서 centerCrop와 레이아웃이다 (그래서 전체 폭 거대한이어야한다) http://tinypic.com/r/vzk7kw/5
그래서 내 생각이됩니다 내 레이아웃에서 보지 못하는 암시 적 최대 높이가 있지만 어디에서 볼 수 없는지, 내 오류를 발견 할 수 있습니까?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/dropshadow"
>
<TextView
android:id="@+id/heading"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
<ImageView
android:id="@+id/featuredimage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="1000dp"
android:scaleType="centerCrop"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
/>
</LinearLayout>
</RelativeLayout>
게시 된 코드에서 LinearLayout을 사용하는 것은 아닙니다. 상대 레이아웃을 사용하여이 작업을 수행 할 수 있습니다. – dcanh121
이미지의 실제 픽셀 크기는 얼마입니까? 이미지를로드하고 설정하는 코드를 게시 할 수 있습니까? –
'maxHeight'를'ScrollView'에 제공하는 해결책을 찾았습니다. 이 솔루션은 모든 유형의보기에도 사용할 수 있습니다. http://chintanrathod.com/maxheightscrollview-in-android-using-android-studio/ –