Adding TextViews to Main Activity View

We are going to add some TextViews for hold info.

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id = "@+id/merchantName"/>

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/inventoryItems"/>

Your Acivity Main view should look like:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.jamescha.clovercodelab.MainActivity">

    <LinearLayout
        android:layout_width="368dp"
        android:layout_height="495dp"
        android:orientation="vertical"
        tools:context="com.jamescha.clovercodelab.MainActivity"
        tools:layout_editor_absoluteY="8dp"
        tools:layout_editor_absoluteX="8dp">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id = "@+id/merchantName"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/inventoryItems"/>
    </LinearLayout>

</android.support.constraint.ConstraintLayout>

results matching ""

    No results matching ""