recyclelerview下面的按钮消失了

时间:2017-06-11 16:48:32

标签: button android-recyclerview

这是我的布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.esraabalbaa.graduationproject.CartActivity">`enter code here <android.support.v7.widget.Toolbar
    android:id="@+id/toolb"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="#009688"
    app:popupTheme="@style/AppTheme.PopupOverlay" >
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/gotoback"
        android:src="@drawable/ic_arrow_back_black_24dp"
        android:layout_alignParentRight="true"
        android:clickable="true"
        />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Cart"
        android:padding="10dp"
        android:textSize="20dp"
        android:textColor="#ffffff"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:textSize="20dp"
        android:id="@+id/selecteditemcounter"
        android:textColor="#ffffff"/>
    </android.support.v7.widget.Toolbar>
<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/mycartrecycler"/>
<Button
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:id="@+id/checkoutsummary"
    android:layout_alignParentBottom="true"
    android:text="Checkout"
    android:textAlignment="center"
    android:textSize="20dp"/>

我在Recyclerview下方显示一个按钮,当我第一次打开活动时,按钮不会出现,只有当我从recyclerview中取消一个项目时它才出现,那么问题是什么?

1 个答案:

答案 0 :(得分:0)

使用布局权重尝试这样的事情:

#problem