【问题标题】:I can't scroll up because of Swipe Refresh Layout由于滑动刷新布局,我无法向上滚动
【发布时间】:2019-04-10 15:40:45
【问题描述】:

很多类似的问题,但我的问题有点不同。向下滚动时,活动完美运行。但是,当我向上滚动而不是滚动时,它会刷新。我真正想要的是它只会在我位于嵌套滚动视图的顶部时刷新。我必须快速双击才能向上滚动,这有点困难。

截图:

详细信息.xml

     <?xml version="1.0" encoding="utf-8"?>
  <android.support.v4.widget.SwipeRefreshLayout 
 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:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".details">
 <android.support.design.circularreveal.
 coordinatorlayout.CircularRevealCoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    android:fitsSystemWindows="true"
    >

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing"
        android:layout_width="match_parent"
        android:layout_height="350dp"
        android:fitsSystemWindows="true"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"
        app:contentScrim="#0e0d0e"
        app:expandedTitleTextAppearance="@android:color/transparent"
        >

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/img_beach"
            android:contentDescription="@null"
            android:scaleType="centerCrop"
            app:layout_collapseMode="parallax"
            />

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:title="Beach Name"
            android:layout_height="?attr/actionBarSize"
            android:layout_width="match_parent"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:layout_collapseMode="parallax"
            />
    </android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>


<android.support.design.widget.FloatingActionButton
    android:id="@+id/btnSubmit"
    android:src="@drawable/send"
    android:backgroundTint="@android:color/white"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:elevation="6dp"
    app:layout_anchor="@id/app_bar_layout"
    app:layout_anchorGravity="bottom|right|end"
    app:pressedTranslationZ="12dp"
    app:useCompatPadding="true"
    />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/btn_rating"
    android:src="@drawable/ic_add_black_24dp"
    android:backgroundTint="@android:color/white"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:elevation="6dp"
    app:layout_anchor="@id/app_bar_layout"
    app:layout_anchorGravity="bottom|right|start"
    app:pressedTranslationZ="12dp"
    app:useCompatPadding="true"
    />

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToPadding="false"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="5dp"
            app:cardUseCompatPadding="true">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/beach_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:padding="12dp"
                    android:text="Food Name"
                    android:textColor="@color/colorPrimary"
                    android:textSize="20sp"
                    android:textStyle="bold" />

                <LinearLayout
                    android:id="@+id/layout_price"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <ImageView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:src="@drawable/money" />

                    <TextView
                        android:id="@+id/beach_price"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="9"
                        android:text="1,000"
                        android:textColor="@color/colorPrimary"
                        android:textSize="18sp"
                        android:textStyle="bold" />


                </LinearLayout>

                <com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
                    android:id="@+id/number_button"
                    android:layout_width="100dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="10dp"
                    app:backGroundColor="@color/number_button"
                    app:finalNumber="20"
                    app:initialNumber="1"
                    app:textSize="8sp" />

                <LinearLayout
                    android:id="@+id/layout_checkDate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_horizontal"
                    android:orientation="horizontal">

                    <Button
                        android:id="@+id/checkInBTN"
                        android:layout_width="90dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="CHECK IN"
                        android:textSize="12sp" />

                    <TextView
                        android:id="@+id/checkInTV"
                        android:layout_width="90dp"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="8dp"
                        android:layout_marginTop="6dp"
                        android:layout_marginBottom="10dp"
                        android:gravity="center_vertical"
                        android:text="CHECK IN DATE"
                        android:textAlignment="center" />

                    <Button
                        android:id="@+id/checkOutBTN"
                        android:layout_width="90dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="CHECK OUT"
                        android:textSize="12sp" />

                    <TextView
                        android:id="@+id/checkOutTV"
                        android:layout_width="90dp"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="8dp"
                        android:layout_marginTop="6dp"
                        android:layout_marginBottom="10dp"
                        android:gravity="center_vertical"
                        android:text="CHECK OUT DATE"
                        android:textAlignment="center" />


                </LinearLayout>

                <LinearLayout
                    android:id="@+id/layout_checkAvailability"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_horizontal"
                    android:orientation="horizontal">

                    <Button
                        android:id="@+id/checkAvailabilityBTN"
                        android:layout_width="160dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:gravity="center|center_horizontal"
                        android:text="CHECK AVAILABILITY"
                        android:textSize="12sp" />

                </LinearLayout>


            </LinearLayout>


        </android.support.v7.widget.CardView>

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="5dp"
            app:cardUseCompatPadding="true">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <RatingBar
                    android:id="@+id/rating_bar"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:isIndicator="true"
                    android:max="5"
                    android:rating="0" />

                <TextView
                    android:id="@+id/beach_description"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:lineSpacingMultiplier="1.5"
                    android:padding="12dp"
                    android:text="Description"
                    android:textColor="@android:color/black"
                    android:textSize="14sp" />

            </LinearLayout>

        </android.support.v7.widget.CardView>

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="5dp"
            app:cardUseCompatPadding="true">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/beach_review"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="18dp"
                    android:lineSpacingMultiplier="1.5"
                    android:padding="12dp"
                    android:text="REVIEWS"
                    android:textColor="@android:color/black"
                    android:textSize="24sp"
                    android:textStyle="bold|italic" />

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recyclerComment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />


            </LinearLayout>

        </android.support.v7.widget.CardView>

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="12dp"
            app:cardUseCompatPadding="true">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/beach_gallery"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="18dp"
                    android:lineSpacingMultiplier="1.5"
                    android:padding="12dp"
                    android:text="GALLERY"
                    android:textColor="@android:color/black"
                    android:textSize="24sp"
                    android:textStyle="bold|italic" />

                <ImageView
                    android:id="@+id/img_beach2"
                    android:layout_width="match_parent"
                    android:layout_height="250dp"
                    android:scaleType="centerCrop"
                    android:src="@drawable/background" />

                <ImageView
                    android:id="@+id/img_beach3"
                    android:layout_width="match_parent"
                    android:layout_height="250dp"
                    android:layout_marginTop="20dp"
                    android:scaleType="centerCrop"
                    android:src="@drawable/background" />


                <ImageView
                    android:id="@+id/img_beach4"
                    android:layout_width="match_parent"
                    android:layout_height="250dp"
                    android:layout_marginTop="20dp"
                    android:scaleType="centerCrop"
                    android:src="@drawable/background" />

            </LinearLayout>

        </android.support.v7.widget.CardView>


    </LinearLayout>


</android.support.v4.widget.NestedScrollView>


 </android.support.design.circularreveal.
 coordinatorlayout.CircularRevealCoordinatorLayout>
 </android.support.v4.widget.SwipeRefreshLayout>

Details.java

        mSwipeRefreshLayout.post(new Runnable() {
        @Override
        public void run() {
            mSwipeRefreshLayout.setRefreshing(true);
            if(!menuID.isEmpty() && menuID != null){

                Query query = ratingTbl.orderByChild("menuID").equalTo(menuID);


                FirebaseRecyclerOptions<Rating> options = new FirebaseRecyclerOptions.Builder<Rating>()
                        .setQuery(query, Rating.class)
                        .build();

                adapter = new FirebaseRecyclerAdapter<Rating, ShowCommentViewHolder>(options) {
                    @Override
                    protected void onBindViewHolder(@NonNull ShowCommentViewHolder holder, int position, @NonNull Rating model) {

                        holder.ratingBar.setRating(Float.parseFloat(model.getRateValue()));
                        holder.txtComment.setText(model.getComment());
                        holder.txtUserEmail.setText(model.getUserEmail());

                    }

                    @NonNull
                    @Override
                    public ShowCommentViewHolder onCreateViewHolder(ViewGroup parent, int i) {
                        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.show_comment_layout, parent, false);
                        return new ShowCommentViewHolder(view);
                    }
                };

                loadComment(menuID);

            }
        }
    });
    mSwipeRefreshLayout.post(new Runnable() {
        @Override
        public void run() {
            mSwipeRefreshLayout.setRefreshing(true);

            if(!menuID.isEmpty() && menuID != null){

                Query query = ratingTbl.orderByChild("menuID").equalTo(menuID);


                FirebaseRecyclerOptions<Rating> options = new FirebaseRecyclerOptions.Builder<Rating>()
                        .setQuery(query, Rating.class)
                        .build();

                adapter = new FirebaseRecyclerAdapter<Rating, ShowCommentViewHolder>(options) {
                    @Override
                    protected void onBindViewHolder(@NonNull ShowCommentViewHolder holder, int position, @NonNull Rating model) {

                        holder.ratingBar.setRating(Float.parseFloat(model.getRateValue()));
                        holder.txtComment.setText(model.getComment());
                        holder.txtUserEmail.setText(model.getUserEmail());

                    }

                    @NonNull
                    @Override
                    public ShowCommentViewHolder onCreateViewHolder(ViewGroup parent, int i) {
                        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.show_comment_layout, parent, false);
                        return new ShowCommentViewHolder(view);
                    }
                };

                loadComment(menuID);
            }


        }
    });

【问题讨论】:

  • 请添加所有相关代码
  • @NikosHidalgo 是的,对不起。忘记添加代码
  • 向上。我的论文急需

标签: android swiperefreshlayout android-nestedscrollview


【解决方案1】:

如果 RecyclerViewListView 不是 SwipeRefreshLayout 的直接子代,则会出现此问题。

最简单的解决方案是提供OnChildScrollUpCallback 实现并适当地返回结果。在下面的 Kotlin 代码中,refreshLayoutSwipeRefreshLayoutrecyclerViewRecyclerView,在 xml 布局代码中也可以看到。

refreshLayout.setOnChildScrollUpCallback(object : SwipeRefreshLayout.OnChildScrollUpCallback {
  override fun canChildScrollUp(parent: SwipeRefreshLayout, child: View?): Boolean {
    if (recyclerView != null) {
      return recyclerView.canScrollVertically(-1)
    }
    return false
  }
})

虽然xml 布局是这样的,

 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/refreshLayout"
    ...
    lots of other views i.e TextView, ImageView, MotionLayout
    ...
    ...
    ...
    <androidx.recyclerview.widget.RecyclerView
       android:id="@+id/recyclerView".../>
       
    ...
    ...
    ...
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

【讨论】:

    【解决方案2】:

    我在ScrollView 上添加了OnScrollChangeListener,以根据滚动的位置启用/禁用SwipeRefreshLayout。我仅在 scrollY 位于顶部且不会妨碍我的 scrollView 时启用滑动刷新。

    Kotlin 中的代码如下所示:

    scrollView.setOnScrollChangeListener { v: View, scrollX: Int, scrollY: Int, _: Int, _: Int ->
            swipeRefreshLayout.isEnabled = scrollY == 0
    }
    

    【讨论】:

      【解决方案3】:

      下面是这样解决的

       scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
              @Override
              public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
                 if(scrollY > 5){
                     mSwipeRefreshLayout.setEnabled(false);
                 }else{
                     mSwipeRefreshLayout.setEnabled(true);
                 }
      
              }
          });
      

      【讨论】:

        【解决方案4】:

        我已经通过将滑动刷新布局放在协调器布局中来修复它。非常感谢所有观众:)

        <?xml version="1.0" encoding="utf-8"?>
        <android.support.design.circularreveal.coordinatorlayout.
        CircularRevealCoordinatorLayout 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"
        tools:context=".details"
        android:layout_height="match_parent">
        
        <android.support.design.widget.AppBarLayout
            android:id="@+id/app_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            android:fitsSystemWindows="true"
            >
        
            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/collapsing"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                android:fitsSystemWindows="true"
                app:layout_scrollFlags="scroll|exitUntilCollapsed"
                app:contentScrim="#0e0d0e"
                app:expandedTitleTextAppearance="@android:color/transparent"
                >
        
                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:id="@+id/img_beach"
                    android:contentDescription="@null"
                    android:scaleType="centerCrop"
                    app:layout_collapseMode="parallax"
                    />
        
                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:title="Beach Name"
                    android:layout_height="?attr/actionBarSize"
                    android:layout_width="match_parent"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                    app:layout_collapseMode="parallax"
                    />
            </android.support.design.widget.CollapsingToolbarLayout>
        
        </android.support.design.widget.AppBarLayout>
        
        
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/btnSubmit"
            android:src="@drawable/send"
            android:backgroundTint="@android:color/white"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:elevation="6dp"
            app:layout_anchor="@id/app_bar_layout"
            app:layout_anchorGravity="bottom|right|end"
            app:pressedTranslationZ="12dp"
            app:useCompatPadding="true"
            />
        
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/btn_rating"
            android:src="@drawable/ic_add_black_24dp"
            android:backgroundTint="@android:color/white"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:elevation="6dp"
            app:layout_anchor="@id/app_bar_layout"
            app:layout_anchorGravity="bottom|right|start"
            app:pressedTranslationZ="12dp"
            app:useCompatPadding="true"
            />
        
        <android.support.v4.widget.SwipeRefreshLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/swipe_layout"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            >
        
        <android.support.v4.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            >
        
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
        
                <android.support.v7.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardElevation="5dp"
                    app:cardUseCompatPadding="true">
        
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
        
                        <TextView
                            android:id="@+id/beach_name"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="8dp"
                            android:padding="12dp"
                            android:text="Food Name"
                            android:textColor="@color/colorPrimary"
                            android:textSize="20sp"
                            android:textStyle="bold" />
        
                        <LinearLayout
                            android:id="@+id/layout_price"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal">
        
                            <ImageView
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1"
                                android:src="@drawable/money" />
        
                            <TextView
                                android:id="@+id/beach_price"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="9"
                                android:text="1,000"
                                android:textColor="@color/colorPrimary"
                                android:textSize="18sp"
                                android:textStyle="bold" />
        
        
                        </LinearLayout>
        
                        <com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
                            android:id="@+id/number_button"
                            android:layout_width="100dp"
                            android:layout_height="30dp"
                            android:layout_marginLeft="8dp"
                            android:layout_marginTop="8dp"
                            android:layout_marginBottom="10dp"
                            app:backGroundColor="@color/number_button"
                            app:finalNumber="20"
                            app:initialNumber="1"
                            app:textSize="8sp" />
        
                        <LinearLayout
                            android:id="@+id/layout_checkDate"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center_horizontal"
                            android:orientation="horizontal">
        
                            <Button
                                android:id="@+id/checkInBTN"
                                android:layout_width="90dp"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="5dp"
                                android:text="CHECK IN"
                                android:textSize="12sp" />
        
                            <TextView
                                android:id="@+id/checkInTV"
                                android:layout_width="90dp"
                                android:layout_height="match_parent"
                                android:layout_marginLeft="8dp"
                                android:layout_marginTop="6dp"
                                android:layout_marginBottom="10dp"
                                android:gravity="center_vertical"
                                android:text="CHECK IN DATE"
                                android:textAlignment="center" />
        
                            <Button
                                android:id="@+id/checkOutBTN"
                                android:layout_width="90dp"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="5dp"
                                android:text="CHECK OUT"
                                android:textSize="12sp" />
        
                            <TextView
                                android:id="@+id/checkOutTV"
                                android:layout_width="90dp"
                                android:layout_height="match_parent"
                                android:layout_marginLeft="8dp"
                                android:layout_marginTop="6dp"
                                android:layout_marginBottom="10dp"
                                android:gravity="center_vertical"
                                android:text="CHECK OUT DATE"
                                android:textAlignment="center" />
        
        
                        </LinearLayout>
        
                        <LinearLayout
                            android:id="@+id/layout_checkAvailability"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center_horizontal"
                            android:orientation="horizontal">
        
                            <Button
                                android:id="@+id/checkAvailabilityBTN"
                                android:layout_width="160dp"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="5dp"
                                android:gravity="center|center_horizontal"
                                android:text="CHECK AVAILABILITY"
                                android:textSize="12sp" />
        
                        </LinearLayout>
        
        
                    </LinearLayout>
        
        
                </android.support.v7.widget.CardView>
        
                <android.support.v7.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardElevation="5dp"
                    app:cardUseCompatPadding="true">
        
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
        
                        <RatingBar
                            android:id="@+id/rating_bar"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="10dp"
                            android:isIndicator="true"
                            android:max="5"
                            android:rating="0" />
        
                        <TextView
                            android:id="@+id/beach_description"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:lineSpacingMultiplier="1.5"
                            android:padding="12dp"
                            android:text="Description"
                            android:textColor="@android:color/black"
                            android:textSize="14sp" />
        
                    </LinearLayout>
        
                </android.support.v7.widget.CardView>
        
                <android.support.v7.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardElevation="5dp"
                    app:cardUseCompatPadding="true">
        
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
        
                        <TextView
                            android:id="@+id/beach_review"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="18dp"
                            android:lineSpacingMultiplier="1.5"
                            android:padding="12dp"
                            android:text="REVIEWS"
                            android:textColor="@android:color/black"
                            android:textSize="24sp"
                            android:textStyle="bold|italic" />
        
                        <android.support.v7.widget.RecyclerView
                            android:id="@+id/recyclerComment"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent" />
        
        
                    </LinearLayout>
        
                </android.support.v7.widget.CardView>
        
                <android.support.v7.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="12dp"
                    app:cardUseCompatPadding="true">
        
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
        
                        <TextView
                            android:id="@+id/beach_gallery"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="18dp"
                            android:lineSpacingMultiplier="1.5"
                            android:padding="12dp"
                            android:text="GALLERY"
                            android:textColor="@android:color/black"
                            android:textSize="24sp"
                            android:textStyle="bold|italic" />
        
                        <ImageView
                            android:id="@+id/img_beach2"
                            android:layout_width="match_parent"
                            android:layout_height="250dp"
                            android:scaleType="centerCrop"
                            android:src="@drawable/background" />
        
                        <ImageView
                            android:id="@+id/img_beach3"
                            android:layout_width="match_parent"
                            android:layout_height="250dp"
                            android:layout_marginTop="20dp"
                            android:scaleType="centerCrop"
                            android:src="@drawable/background" />
        
        
                        <ImageView
                            android:id="@+id/img_beach4"
                            android:layout_width="match_parent"
                            android:layout_height="250dp"
                            android:layout_marginTop="20dp"
                            android:scaleType="centerCrop"
                            android:src="@drawable/background" />
        
                    </LinearLayout>
        
                </android.support.v7.widget.CardView>
        
        
            </LinearLayout>
        
        
        </android.support.v4.widget.NestedScrollView>
        
        </android.support.v4.widget.SwipeRefreshLayout>
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-11-28
          • 1970-01-01
          相关资源
          最近更新 更多