このレイアウトをすべてのアンドロイド画面サイズに対応させようとしています。私は別のレイアウトフォルダを作るように多くのことを試しましたが、動作しません。 私もこのリンクを訪問しましたが、私はそれほど理解していません。 すべてのアンドロイド画面サイズでcardviewsと互換性のあるレイアウトを作成する方法
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scr"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/parentPanel"
android:padding="2dp">
<TextView
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@drawable/nav_banner_background"
android:text="Vendors Type"
android:textAlignment="center"
android:textSize="20dp"
android:textColor="@color/buttonText"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/firstPanel">
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_mehandi"
android:layout_width="160dp"
android:layout_height="150dp"
card_view:cardCornerRadius="6dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="photo"
android:id="@+id/photographerImageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_photographer" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Photographer"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_barat"
android:layout_width="160dp"
android:layout_height="150dp"
android:layout_margin="5dp"
card_view:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="cat"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_wedding_caterer"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Caterer"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/secondPanel">
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_walima"
android:layout_width="160dp"
android:layout_height="150dp"
card_view:cardCornerRadius="6dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="org"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_wedding_organizer"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Organizer"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_nikah"
android:layout_width="160dp"
android:layout_height="150dp"
android:layout_margin="5dp"
card_view:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="flow"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_flower_deco" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Flower Decorer"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/thirdPanel">
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_engagement"
android:layout_width="160dp"
android:layout_height="150dp"
card_view:cardCornerRadius="6dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="dec"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_wedding_decorations" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Wedding Decorator"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_aqeeqah"
android:layout_width="160dp"
android:layout_height="150dp"
android:layout_margin="5dp"
card_view:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:onClick="dj"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:scaleType="centerCrop"
android:background="@drawable/vender_dj"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="DJ"
android:layout_marginLeft="50dp"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView>