У меня есть такая проблема: в моем портретном режиме я использовал карточку, чтобы содержать изображения и тексты в массиве, и они взяли два столбца, что меня устраивает. Но то же самое происходит и в ландшафтном телефоне Android, это создает пространство между изображением и после него. Как сделать столбцы в альбомной ориентации три (3)? Вот код для портретной раскладки:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_columnSpan="2"
android:layout_column="2">
<android.support.v7.widget.CardView
android:layout_width="165dp"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="9dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="@color/bright_foreground_material_dark"
card_view:cardCornerRadius="3dp"
card_view:cardElevation="0.01dp">
<RelativeLayout
android:id="@+id/top_layout"
android:layout_width="165dp"
android:layout_height="160dp">
<ImageView
android:id="@+id/img_thumbnail"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_above="@+id/tv_species"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tv_species"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="bottom"
android:background="@color/custom_two"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:paddingRight="2dp"
android:text="Test"
android:textColor="#fff"
android:textSize="20dp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
GridView/RecyclerView
и устанавливаете для столбцов значение 2? - person M090009   schedule 04.11.2015