뷰에 내용을 최소한으로 포장해야하지만 상위 뷰에서 스트레칭, 그것이 부모를 채우기보다?Android 레이아웃 - 부모에게 내용을 채우지 만 내용은 적어도 랩핑해야 함을 뷰에 알리는 방법
예 :
내가 원하는, 그것은 콘텐츠의 ... 그리고 그 경우에 내 제목 텍스트 뷰는 스크롤 뷰보다 넓은 주위에 컨테이너 선형 레이아웃을 감싸는 것을, 그것을 잘라하지 않습니다! 내가 wrap_content에 제목 텍스트 뷰를 설정하면, 그것은 무엇을 의미하는 이미지 뷰 인 경우
이<LinearLayout
android:id="@+id/llWeightsParent"
style="@style/group"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:clickable="true"
android:onClick="onClick"
android:orientation="vertical" >
<TextView
android:id="@+id/tvWeight"
style="@style/text_group_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:text="@string/weight" />
<ScrollView
android:id="@+id/svWeights"
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/llWeights"
style="@style/group_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
</LinearLayout>
일부 코드는 문제에 대해 자세히 설명해줍니다. –
은 'LinearLayout' 또는'RelativeLayout'으로 텍스트보기를 둘러 쌉니다. 주변 레이아웃은 match_parent와'TextView' wrap_content를 가지므로 부모를 채우고 wrap_content도 갖습니다. – bogdan
방금 시도했는데 ... 역시 작동하지 않습니다 ... 여전히 내 예제와 같은 동작입니다 ... – prom85