Я новичок в разработке Android-приложений. И я пытаюсь сделать приложение, которое отображает ежедневные процедуры моих классов. Я уже сделал 75% заявки, но я застрял в последних 25%. Я просто не могу сделать стол, как на картинке. Пожалуйста, помогите мне.Android Studio layout layout как
0
A
ответ
-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>
У меня была проблема похожа на вашу, и я сделал это, я надеюсь, что это будет работать для вас.
+1
Опишите действие вашего кода вверху, пожалуйста. –
Привет, Utsav, что вам нужно в ячейках таблицы EditText или textView? –
Вы хотите только просмотр текста в наших ячейках таблицы? –
Есть ли причина, почему нет разницы в 2 фотографии? –