2012-02-03 5 views
0

선형 레이아웃의 텍스트 뷰 및 편집 텍스트가 있습니다. 내가 볼 수있는 부모의 비율로 너비를 설정하기 위해 가중치를 사용하는 모든 예를 보았던 것처럼 모든 뷰가 전혀 표시되지 않습니다.Android 무게가 작동하지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
<TextView 
    android:id="@+id/custLabel" 
    android:layout_height="wrap_content" 
    android:layout_weight=".35" 
    android:layout_width="0dip" 
    android:text="Name"/> 
<EditText 
    android:id="@+id/customer" 
    android:layout_height="wrap_content" 
    android:layout_weight=".65" 
    android:layout_width="0dip"/> 
</LinearLayout> 
+0

visual studio에서 모노 드로이드를 사용하고 있습니다. 장치에 직접 디버깅. – jmease

+0

'LinearLayout'은 세로 방향입니다. 'TextView'와'EditText'에 대해'layout_width'를''wrap_content''와'layout_height'을'0dp'로 설정하십시오. 당신은 잘못하고있는 중입니다. – Squonk

+0

@MisterSquonk 내가 전문가의 일부보다 금식 한 것은 처음이다 :-) – Gangnus

답변

2

레이아웃의 방향을 변경하십시오. 너는 수직으로하고 거기에 물건을 넣고 너비를 가중한다!

+0

3 일 전에 잘못된 LinearLayout 오리엔테이션 때문에 3 시간을 낭비했습니다 :-) – Gangnus

+0

그랬습니다. 4 분 안에 수락 할 것입니다. 감사! – jmease

관련 문제