Answer the question
In order to leave comments, you need to log in
How to add elements to LinearLayout?
Hello, I have this code. You need to add 3 textview elements on top of the existing ones (a header for the table). How to do this, I have already twisted all the forums, everything floats and does not work. There is no time to study layout comprehensively.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="Horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="25px"
android:minHeight="25px"
android:weightSum="100">
<TextView
android:text="Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="25"
android:id="@+id/txtId" />
<TextView
android:text="Last Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="25"
android:id="@+id/txtName " />
<TextView
android:text="Age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="25"
android:id="@+id/txtPrice " />
<TextView
android:text="Gender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight ="25"
android:id="@+id/txtQuantity" />
</LinearLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question