2012-09-23 5 views
0

4 개의 TextView가 포함 된 가로형 LinearLayout이 있습니다. 때로는 이러한 텍스트 뷰 중 하나의 텍스트가 길고 마지막 텍스트 뷰가 레이아웃에 올바르게 맞지 않을 수 있습니다.
물론 하나의 텍스트 뷰를 설정할 수 있지만 텍스트가 다른 위치에서 설정되고 스타일이 다르기 때문에 최적이 아닙니다.
어떻게 해결할 수 있을까요?
고마워요.android 여러 텍스트 뷰에서 레이아웃 및 텍스트 랩

답변

0

가중치를 사용하여 LinearLayout의 뷰를 각각 25 %로 분산시킬 수 있습니다.

(예를 들어, 오타 안된 함유 할 수있다) :

<LinearLayout android:weightSum="100" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> 
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView> 
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView> 
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView> 
<TextView android:layout_weight="25" android:layout_width="0dp" android:layout_height="wrap_content"></TextView> 
</LinearLayout> 
관련 문제