Skip to content

布局中如果没有android:id="@id/swipe_target",可以根据顺序判断header、target、footer #138

Open
ruiaa wants to merge 3 commits intoAspsine:masterfrom
ruiaa:master
Open

布局中如果没有android:id="@id/swipe_target",可以根据顺序判断header、target、footer #138
ruiaa wants to merge 3 commits intoAspsine:masterfrom
ruiaa:master

Conversation

@ruiaa
Copy link

@ruiaa ruiaa commented Nov 9, 2017

if (mTargetView==null){
switch (childNum){
case 1:{
mTargetView=getChildAt(0);
break;
}
case 2:{
if (mFooterView!=null){
mTargetView=getChildAt(0);
}else {
mHeaderView=getChildAt(0);
mTargetView=getChildAt(1);
}
break;
}
case 3:{
mHeaderView=getChildAt(0);
mTargetView=getChildAt(1);
mFooterView=getChildAt(2);
break;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant