마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

xml 정렬 비율 weight 도움 부탁드립니다.

0 추천
<LinearLayout
		    android:layout_width="match_parent"
		    android:layout_height="wrap_content"
		    android:orientation="horizontal" 
		    android:layout_weight="1"
		    android:weightSum="1"
		    android:gravity="center"
		    android:visibility="visible"
		    >
		    
		    <TextView
		        android:layout_weight="0.45"
		        android:layout_width="match_parent"
		        android:layout_height="40dp"
		        android:background="@drawable/edit_login"
		        android:paddingLeft="10dp"
		        android:textSize="15dp" />

		    <TextView
		        android:gravity="center"
		        android:text="~"
                android:layout_weight="0.1"
                android:textSize="15dp"
				android:paddingLeft="10dp"
                android:layout_width="match_parent"
                android:layout_height="40dp" />
			
		    <TextView
		        android:layout_weight="0.45"
		        android:layout_width="match_parent"
		        android:layout_height="40dp"
		        android:background="@drawable/edit_login"
		        android:paddingLeft="10dp"
		        android:textSize="15dp" />
		    
		</LinearLayout>

4.5 : 1 : 4.5 로 하려고 하는데 계속 틀어지고 늘어나네요... 제가 잘못된 방법으로 하고 있는지 도와주세요.

heopsop (280 포인트) 님이 2015년 8월 5일 질문
height 값을 0dp 변경하시면 됩니다.

1개의 답변

+2 추천
layout_width를 0dp로 바꿔보세요.

그리고 paddingLeft 때문에 이상하게 보이는 걸 수도 있을 것 같아요
쎄미 (162,410 포인트) 님이 2015년 8월 5일 답변
...