# CeilingLayout-master
**Repository Path**: wasadsdfa/CeilingLayout-master
## Basic Information
- **Project Name**: CeilingLayout-master
- **Description**: 吸顶Demo
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-02-28
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## 1、描述
**`CeilingLayout`用来控制子View的吸顶联滑,理论上支持实现了NestedScrollingChild的联滑控件,如`NestedScrollView`、`RecyclerView`、`SmartRefreshLayout`等;只需要在xml里配置需要吸顶子View的位置索引就能自动实现吸顶联滑效果。**
## 2、模型图
`CeilingLayout`是`LinearLayout`的子类,使用方法与竖向`LinearLayout`一致。

如模型图所示,`CeilingLayout`竖向排列子View时,吸顶子View之后有且只能再排列一个子View,一般为联动View或包裹住联动View的父容器。
## 3、xml属性
|方法名|参数|描述|
|:---:|:---:|:---:|
| ceiling_childIndex | integer | 吸顶子View的位置索引
## 4、使用
- **xml配置**
```xml
```
## 5、gradle
add the dependency:
```gradle
dependencies {
...
implementation 'com.github.xubo.ceilinglayout:CeilingLayout:1.1.1'
}
```
## 6、sample
|示例|
|:---:|
|
|
## 7、注意事项
### 1)、已验证联动View表
- [x] `NestedScrollView`
- [x] `RecyclerView`
- [x] `SmartRefreshLayout`
### 2)、SmartRefreshLayout-1.1.0已不支持联动
由于`SmartRefreshLayout`在`1.1.0`注释了`NestedScrollingChild`接口实现,表明无法支持与Parent View的嵌套滑动,所以`CeilingLayout`目前无法支持`SmartRefreshLayout-1.1.0`联动。
如果需要与`SmartRefreshLayout`联动,建议把`SmartRefreshLayout`降级到`1.0.5`。
### 3)、错误的位置索引配置
> * 不存在的子View位置索引
> * 位置索引为0,索引为0吸顶毫无意义