# nested-scroll-body
基礎(chǔ)庫(kù) 3.2.0 開(kāi)始支持,低版本需做兼容處理。
相關(guān)文檔: Skyline 渲染引擎、Skyline 遷移起步
渲染框架支持情況:Skyline (使用最新 Nightly 工具調(diào)試)
# 功能描述
嵌套 scroll-view 場(chǎng)景中屬于里層 scroll-view 的節(jié)點(diǎn),僅支持作為 <scroll-view type="nested"> 模式的直接子節(jié)點(diǎn)。不支持復(fù)數(shù)子節(jié)點(diǎn),渲染時(shí)會(huì)取其第一個(gè)子節(jié)點(diǎn)來(lái)渲染。具體用法可參考 scroll-view
# 屬性說(shuō)明
| 屬性 | 類(lèi)型 | 默認(rèn)值 | 必填 | 說(shuō)明 | 最低版本 |
|---|---|---|---|---|---|
| offset-top | number | 0 | 否 | 滾動(dòng)目標(biāo)距離頂部的距離(px)。在外層 scroll-view 滾動(dòng)時(shí)此組件會(huì)在主軸方向會(huì)逐漸撐開(kāi),直到此組件頂部與視窗頂部距離為該屬性值時(shí)才開(kāi)始里層 scroll-view 的滾動(dòng)。默認(rèn)為 0,即表示此組件撐開(kāi)到頂部與視窗頂部齊平時(shí)才開(kāi)始里層 scroll-view 的滾動(dòng)。 | 3.6.2 |
# 使用方法
<scroll-view
type="nested"
scroll-y
>
<nested-scroll-header>
<view></view>
</nested-scroll-header>
<nested-scroll-body>
<scroll-view
type="list"
scroll-y
>
<view>嵌套里層的 scroll-view</view>
</scroll-view>
<view>不會(huì)渲染,因?yàn)?nested-scroll-body 只會(huì)渲染第一個(gè)子節(jié)點(diǎn)</view>
</nested-scroll-body>
</scroll-view>