包裹RecyclerView边框线(横线和竖线)

先看效果图是的话就参考一下

.在这里插入图片描述

代码
  <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#E3E3E3" />

                    <View
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:layout_alignParentLeft="true"  //基于父容器左侧
                        android:background="#E3E3E3" />

                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/trastion_buy_right_two_recycler"
                        android:layout_width="140dp"
                        android:layout_height="133dp"
                        android:paddingLeft="5dp"
                        android:paddingRight="5dp"
                        android:paddingBottom="5dp" />

                    <View
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:layout_alignParentRight="true"  //基于父容器右侧
                        android:background="#E3E3E3" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:layout_alignParentBottom="true"   //基于父容器底部
                        android:background="#E3E3E3" />
                </RelativeLayout>

其中 android:layout_alignParentBottom android:layout_alignParentRight android:layout_alignParentLeft 是RelativeLayout布局中属性意思是基于父容器 如果还想再看一下这个布局的其他的属性请点击

这里跳转RelativeLayout其他属性

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章