2017-02-01 5 views
0

나는 안드로이드 애플 리케이션을 처음 개발 중입니다. 그리고 나는 수업의 일상을 표시하는 응용 프로그램을 만들려고 노력하고 있습니다. 나는 이미 신청서의 75 %를 만들었지 만 나는 지난 25 %에 갇혀있다. 나는 그림 에서처럼 테이블을 만들 수 없다. 도와주세요.안드로이드 스튜디오 테이블 레이아웃 방법

+0

Hi Utsav, EditText 또는 textView의 테이블 셀에 무엇이 필요합니까? –

+0

테이블 셀에서만 텍스트보기를 원하십니까? –

+0

왜 2 장의 사진에는 차이가 없는지 이유가 무엇입니까? –

답변

-1
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="@color/gray"> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:background="@color/gray" 
    android:orientation="vertical" 
    android:layout_marginTop="10dp"> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 

<TableLayout 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:background="@color/gray" 
    android:orientation="horizontal" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp"> 

    <TableRow 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@mipmap/bus" /> 
    </TableRow> 

</TableLayout> 

<TableLayout 
    android:id="@+id/origen" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@color/gray" 
    android:orientation="vertical"> 
<TableRow 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 
    <TextView 
     android:id="@+id/tv_ponit_origdin" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:text="Tapo" 
     android:textSize="10sp" 
     android:textColor="@color/white"/> 
</TableRow> 

    <TableRow> 

     <TextView 
      android:id="@+id/tv_ponit_origin" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:text="Ciudad de Mexico" 
      android:textSize="10sp" 
      android:textColor="@color/white"/> 
    </TableRow> 
</TableLayout> 

<android.support.v4.widget.Space 
    android:layout_width="15dp" 
    android:layout_height="0dp" /> 
<TableRow 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:orientation="horizontal"> 

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:src="@mipmap/transfer" /> 
</TableRow> 

<android.support.v4.widget.Space 
    android:layout_width="15dp" 
    android:layout_height="0dp" /> 
<TableLayout 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:background="@color/gray" 
    android:orientation="horizontal" 
    android:layout_marginRight="10dp"> 

    <TableRow 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@mipmap/bus" /> 
    </TableRow> 
</TableLayout> 
<TableLayout 
    android:id="@+id/destino" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@color/gray" 
    android:orientation="vertical"> 
    <TableRow 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 
     <TextView 
      android:id="@+id/tv_ponit_destino" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:text="Veracruz" 
      android:textSize="10sp" 
      android:textColor="@color/white"/> 
    </TableRow> 

    <TableRow> 

     <TextView 
      android:id="@+id/tv_ponit_two_destino" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:text="Veracruz, Ver." 
      android:textSize="10sp" 
      android:textColor="@color/white"/> 
    </TableRow> 
</TableLayout> 


<android.support.v4.widget.Space 
    android:layout_width="15dp" 
    android:layout_height="0dp" /> 


<TableRow 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 

    <TextView 
     android:id="@+id/tv_departure_time" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:textSize="20sp" 
     android:text="12:00" 
     android:gravity="center" 
     android:textColor="@color/white"/> 
</TableRow> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:layout_marginTop="5dp"> 

    <TableLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <TableRow 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginLeft="20dp"> 

      <TextView 
       android:id="@+id/tv_inf_exit" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:textColor="@color/white" 
       android:text="Salida:" 
       android:textSize="10sp" 
       android:layout_marginRight="5dp"/> 


      <TextView 
       android:id="@+id/tv_exit" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:text="02 Mar 2017" 
       android:textColor="@color/white" 
       android:gravity="center" 
       android:textSize="10sp" 
       android:layout_marginRight="30dp"/> 

      <TextView 
       android:id="@+id/tv_inf_places_sold" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight="1" 
       android:gravity="center" 
       android:text="@string/plases_sold" 
       android:textColor="@color/white" 
       android:textSize="10sp" 
       android:layout_marginRight="5dp"/> 

      <TextView 
       android:id="@+id/tv_places_sold" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight="1" 
       android:gravity="center" 
       android:text="42" 
       android:textColor="@color/white" 
       android:textSize="10sp" 
       android:layout_marginRight="30dp"/> 

      <TextView 
       android:id="@+id/tv_info_race_number" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:gravity="center" 
       android:text="@string/race_number" 
       android:textColor="@color/white" 
       android:textSize="10sp" 
       android:layout_marginRight="5dp"/> 

      <TextView 
       android:id="@+id/tv_race_number" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:gravity="center" 
       android:text="20000" 
       android:textColor="@color/white" 
       android:textSize="10sp" /> 

     </TableRow> 
    </TableLayout> 
</LinearLayout> 
    </LinearLayout> 

required table layout

table layout

나는 당신과 비슷한 문제를 가지고 내가 그것을했다, 나는 당신을 위해 작동 바랍니다.

+1

상단에 코드 동작을 설명하십시오. –