Comments (5)
它主要是间隔作用,颜色就是背景色,看你设置背景色能不能达到需求,不能的话我处理一下可以设置分隔颜色的情况吧。
from byrecyclerview.
我背景没颜色,我直线通过add添加颜色,我网上找了别的工具类替代了
from byrecyclerview.
addHeaderView 这个怎么设置了没法剧中呢??
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="?android:selectableItemBackground"
android:orientation="vertical"
android:padding="@dimen/dp_10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/ivRes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@mipmap/ic_launcher_foreground" />
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_8"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_14"
tools:text="@string/app_name" />
</LinearLayout>
</FrameLayout>
</layout>
from byrecyclerview.
val mMainMenuHeaderBinding = DataBindingUtil.inflate<ActivityMainMenuHeaderBinding>(
LayoutInflater.from(this),
R.layout.activity_main_menu_header,
null,
false
)
mViewDataBinding.includeDrawerlayout.rvMenu.addHeaderView(mMainMenuHeaderBinding.root)
from byrecyclerview.
val mMainMenuHeaderBinding = DataBindingUtil.inflate<ActivityMainMenuHeaderBinding>(
LayoutInflater.from(this),
R.layout.activity_main_menu_header,
recyclerView.getParent(),
false
)
主要是第三个参数:recyclerView.getParent()
from byrecyclerview.
Related Issues (20)
- 仓库下载不到资源
- item 悬浮置顶加入下拉刷新 ,悬浮错位! HOT 2
- 计划新增 侧滑和拖拽功能 HOT 3
- 计划新增 ViewBinding使用示例 HOT 1
- 计划 同步代码到gitee
- 怎样在xml绑定数据 HOT 1
- 添加headerview后,主体内容却不显示了 HOT 2
- 发现一个bug HOT 8
- setStackFromEnd = true 下拉刷新有点不正常 HOT 14
- 可以增加一个treeview的的适配器吗 HOT 4
- can show the second floor demo? HOT 1
- 希望增加一个功能 HOT 4
- 大佬,何时增加多级列表 HOT 2
- 列表在吸顶状态,然后detach再重新attach时,出现2个吸顶布局 HOT 11
- Demo中可以增加字母索引的案例吗 HOT 2
- 报废或附加的视图可能无法回收
- 大牛真厉害 HOT 1
- 给大牛ByRecyclerView提建议 HOT 8
- 嵌套和多级列表问题
- 多类型不能使用databing吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byrecyclerview.