Я использую GridView в своем коде. У меня проблема с пространством. Это моя проблема:Пробелы между элементами GridView
Когда текст не коротка, не проблема, но проблема в том, когда больше. Я хочу, чтобы получить это:
Это мой GridView:
<GridView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="5dp"
android:layout_weight="1"
android:divider="@color/transparente"
android:horizontalSpacing="4dp"
android:longClickable="true"
android:numColumns="2"
android:scrollbars="none"
android:verticalSpacing="4dp" >
</GridView>
И это XML-элементов в GridView:
<LinearLayout 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:layout_margin="5dp"
android:gravity="center_vertical"
android:paddingLeft="5dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingTop="2dp" >
<TextView
android:id="@+id/textView_title_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text text text text text text"
android:textColor="@color/blanco"
android:textSize="@dimen/titulos" />
<TextView
android:id="@+id/textView_alarm_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text text text text text text"
android:textColor="@color/blanco"
android:textSize="@dimen/contenido" />
<TextView
android:id="@+id/textView_alarm_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text text text text text text"
android:textColor="@color/blanco"
android:textSize="@dimen/contenido" />
</LinearLayout>
</LinearLayout>
Я пытался использование android: stretchMode = "spacingWidth", "columnWidth" and android: verticalSpacing = "4DP"
... но безуспешно
Я искал ответы, но не могу найти что-нибудь, чтобы помочь мне
Я признателен за любую помощь
Спасибо и привет
что делать, если вы устанавливаете layout_height основного LinearLayout элемента в "match_parent" вместо "wrap_content"? – mihail
Я уже пробовал это изменение, но не работает – Sergio76