2013-09-07 3 views
0

이 첫 번째 질문은 잘못된 길을 묻는다면 안내해주세요. 게임에서 그림, 제목 및 간단한 설명이있는 문자 수를 표시하는 표를 사용하고 싶습니다. 문자를 클릭하면 사용자는 문자에 대한 자세한 정보를 볼 수있는 다른보기로 이동합니다.안드로이드에서 테이블을 만드는 방법은 그림과 2 textviews가?

+0

당신은 무엇을 시도의 요구 사항에 따라 android:weightSumandroid:layout_weight를 사용할 수 있습니까? 우리에게 보여줄 코드가 있습니까? (당신이 먼저 시도하지 않으면 사람들이 당신을 도우 려하지 않을 것입니다.) –

답변

1

첫 번째 행의 TextView(Title)ImageView(Your Picture)TextView(Brief Description) 인 첫 번째 행의 레이아웃으로 가정합니다. 당신은 당신의 TableRow

<LinearLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"> 

<TableLayout 
    android:layout_height="fill_parent" 
    android:layout_width="wrap_content" 
    android:weightSum="3" 
> 

    <TableRow 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:layout_weight="1" 
     > 
     <TextView 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:layout_span="2" 
     android:text="Title" 
      /> 
    </TableRow> 

    <TableRow 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:layout_weight="2" 
     > 
     <ImageView 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:src="drawable/...png" 
      /> 
     <TextView 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:text="Brief Description" 
      /> 
    </TableRow> 
    </TableLayout> 
    </LinearLayout> 
관련 문제