<GridLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="2" android:alignmentMode="alignBounds" android:rowCount="2" android:columnCount="2" android:columnOrderPreserved="false" android:padding="@dimen/gap16" android:orientation="horizontal">
<android.support.v7.widget.CardView android:layout_columnWeight="1" android:layout_rowWeight="1" android:layout_gravity="fill" android:layout_column="0" android:layout_row="0" android:layout_margin="@dimen/gap16" app:cardCornerRadius="@dimen/gap3" app:cardElevation="@dimen/gap3">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="fill" android:orientation="vertical">
<Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="button 1" android:background="@color/colorOdoOrange" android:textColor="@color/colorWhite" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView android:layout_columnWeight="1" android:layout_rowWeight="1" android:layout_gravity="fill" android:layout_column="1" android:layout_row="1" android:layout_margin="@dimen/gap16" app:cardCornerRadius="@dimen/gap3" app:cardElevation="@dimen/gap16">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="fill" android:orientation="vertical">
<Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="button 2" android:background="@color/colorOdoOrange" android:textColor="@color/colorWhite" />
</LinearLayout>
</android.support.v7.widget.CardView>
</GridLayout>
VS
<mn.odo.ordersystem.components.OdoGridView android:id="@+id/lv_goods_images" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/gap16" android:layout_marginBottom="@dimen/gap16" android:isScrollContainer="false" android:columnWidth="0dp" android:gravity="center" android:numColumns="5" android:stretchMode="columnWidth" android:horizontalSpacing="@dimen/gap0" android:verticalSpacing="@dimen/gap0" />
gridview item:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical">
<Button android:id="@+id/item_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/colorBgSubTitleBlue" android:text="button 0" />
</LinearLayout>
No comments:
Post a Comment