cnbleu / SlideDetailsLayout

高仿淘宝、京东商品详情页面的上拉加载图文详情功能。

Home Page:http://www.cnbleu.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于onLayout中对子View计算的疑问

darkwh opened this issue · comments

if (child == mBehindView) {
top = b + offset;
bottom = top + b - t;

        }
        else {
        //此处为什么要给一个t而不是0呢
         top = t + offset;
         bottom = b + offset;

        }

我集成到我的项目中发现顶部有一个空白区域,空白区域的高度就是t的值,对于这里不是很明白,希望能得到作者的解答~~~

大佬是怎么解决的啊 我的也是只要不是根视图就用空白

if (child == mBehindView) {
top = b + offset - t;
bottom = top + b - t;
} else {
top = offset;
bottom = b + offset;
}
这样可以解顶部有一个空白区域