【发布时间】:2016-07-29 07:54:01
【问题描述】:
我正在尝试创建这种效果
我正在使用回收站视图,但我的问题是每张卡片都是屏幕宽度的 100%,而不是 70%。
这是每个项目的xml代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rowLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/scale_20dp">
<LinearLayout
android:id="@+id/button_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/currentYear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/paymentscreengrey"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="35dp"
android:paddingTop="@dimen/scale_50dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/scale_20dp"
android:text="**** **** **** 5432"
android:textColor="@color/white"
android:textSize="@dimen/scale_20dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2345"
android:textColor="@color/white"
android:textSize="@dimen/scale_16dp" />
【问题讨论】:
-
您可以使用视图寻呼机代替回收站视图,默认情况下您需要此功能refer this
-
你能动态添加项目到浏览器吗?
-
是的,您可以动态添加/删除视图寻呼机
-
是否可以让viewpager只占用70%的屏幕尺寸?
-
@saravinfern -》能否请您指出viewpager的具体方法?
标签: android xml android-layout