I use GridLayout to make a table with 2 horizontal and 4 vertical squares.TextView with address on the right side of the TextView with address written on it, but this TextView sticks out to the right side of the screen.Is it possible to adjust this well to the GridLayout display area?
The layout XML looks like this.
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:useDefaultMargins="true">
<TextView
android:text="Phone number"
android: textColor="@color/colorPrimary"/>
<TextView
android: id="@+id/tel"/>
<TextView
android:text="Address"
android: textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/address"
android:text="Roppongi XXXX-YYYY-ZZZ-123456 789000 123456 789"/>
<!--- hereinafter abbreviated -->
</GridLayout>
<GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:useDefaultMargins="true">
<TextView
android:text="Phone number"
android: textColor="@color/colorPrimary"/>
<TextView
android: id="@+id/tel"
tools:text="0123456"/>
<TextView
android:text="Address"
android: textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/address"
android:layout_width="0dp"
android:layout_gravity="fill_horizontal"
tools:text="Roppongi XXXX-YYYY-ZZZ-123456 789000 123456 789"/>
<!--- hereinafter abbreviated -->
</GridLayout>
© 2024 OneMinuteCode. All rights reserved.