Tablerow line division - Layout

Asked

Viewed 387 times

1

I was looking over Tablerow and developing a test app with this layout template and a question arose. I have a Table with 1 Row and two columns, whose situation is shown in the figure below. However in column 2 it is not fully filled by content, is it possible for me to "split" this column like this and insert another textView below this one that she already has to complete the content? For then I would enter the temperature value below the writing "Temperature"

1 answer

0


Tablerow should be used inside Tablelayout, if it is not behaving like a horizontal Linearlayout.

Tablerow being a layout(extends Linearlayout) can contain any view, including other layout type.

So, to be able to have both Textview one below the other, place them inside a Linearlayout with vertical orientation:

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

        <TableRow>
            <ImageView
                android:src="@drawable/ic_weathernow"/>
            <LinearLayout
                android:orientation="vertical">
                <TextView
                    android:layout_height="match_parent"
                    android:layout_width="wrap_content"
                    android:text="Temperatura"/>
                <TextView
                    android:layout_height="match_parent"
                    android:layout_width="wrap_content"
                    android:text="28º"
                    android:layout_gravity="center"/>
            </LinearLayout>
        </TableRow>
    </TableLayout>
...
  • Oops, thank you very much! For this solution worked! Now I’m inserting a Row table with 2 columns and another tablerow with 4 columns being 2 imageview and 2 textview (alternated) and is appearing only an imageview and a textview, know tell me what can be?

  • It may be for several reasons. It is best to give this question as settled and make another.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.