मैं कई CardView
के रूप में एक्सएमएल में परिभाषित:परिवर्तनीय ऊंचाई के साथ कार्डव्यू का ग्रिड लेआउट कैसे बनाएं?
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardPreventCornerOverlap="false"
card_view:cardCornerRadius="4dp">
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:textSize="@dimen/abc_text_size_title_material"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
फोन के लिए, मैं लिपटे है कई CardView
'है रों एक ऊर्ध्वाधर LinearLayout
में:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
टेबलेट के लिए, मैं चाहते हैं Material Design specs में उपयोग किए गए डिज़ाइन के समान, इसके बजाय ग्रिड लेआउट का उपयोग करें, छवि here देखें।
ग्रिड लेआउट बनाने के लिए उपयोग करने के लिए सबसे अच्छा ViewGroup
क्या है? कार्ड परिवर्तनीय ऊंचाई के हैं, और स्थिर सामग्री है।
GridLayout
का उपयोग नहीं किया जा सकता है, क्योंकि कार्ड परिवर्तनीय ऊंचाई के हैं।
दूसरा विकल्प सबसे अच्छा मुझे लगता है .. – Hardy