2016-09-23 5 views
0
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
<TableLayout 
    android:background="#000000" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
    <TableRow 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:weightSum="0.95" 
     android:layout_marginLeft="0.1dp" 
     android:layout_marginBottom="0.1dp" 
     android:layout_marginRight="0dp" 
     android:layout_marginTop="0dp" 
     > 
     <EditText 
      android:id="@+id/et_1" 
      android:layout_weight="0.1" 
      android:layout_marginRight="0.1dp" 
      android:background="@color/color_white" 
      android:layout_height="match_parent" 
      android:layout_width="0dp" 
      android:text="hell wolrd" 
      android:inputType="text" 

      /> 
     <EditText 
      android:id="@+id/et_2" 
      android:layout_weight="0.55" 
      android:layout_marginTop="0dp" 
      android:layout_marginRight="0.1dp" 
      android:background="@color/color_white" 
      android:layout_height="wrap_content" 
      android:layout_width="0dp" 
      android:paddingTop="5dp" 
      android:text="hell wolrd" 
      android:inputType="textCapSentences|textMultiLine" 
      /> 
     <Spinner 
      android:id="@+id/spinner_3" 
      android:layout_weight="0.15" 
      android:layout_marginRight="0.1dp" 
      android:background="@color/color_white" 
      android:layout_height="match_parent" 
      android:layout_width="0dp" 
      ></Spinner> 
     <EditText 
      android:id="@+id/et_4" 
      android:layout_weight="0.15" 
      android:layout_marginRight="0.1dp" 
      android:background="@color/color_white" 
      android:layout_height="match_parent" 
      android:layout_width="0dp" 
      android:inputType="text" 
      /> 
    </TableRow> 
</TableLayout> 
</LinearLayout> 

다음은 내 XML 파일로 다음 결과를 보여줍니다.android table layout 상단 여백

enter image description here

하지만이 코드를 실행하면 화면이 표시이 : 는 두 번째 편집 텍스트는 문제를주고있다. 아무도 도와 줄 수 있다면 친절하게 가능한 이유는 무엇일까요? 여백입니까? 클래스 파일에서 아무 것도 변경하지 않는 경우 왜 발생합니까?

enter image description here

+0

에 글고 치기 (et_2)에서

android:layout_height="wrap_content" 

을 변경하세요? 테마에서 margin = "0"과 padding = "0"을 설정하려고 시도하십시오. – parohy

+0

효과 없음. 문제는 다른 곳에있다. –

답변

3

사용중인 테마 스타일을 점검

android:layout_height="match_parent"