CustomListView를 만들었습니다. 이제 ShowCaseView를 사용하여 목록 뷰를 비우면 표시됩니다. 윌 가능합니다.목록보기가 비어있을 때 ShowCaseView를 표시하는 방법
-2
A
답변
0
아마도 전에 초기화를 실행하거나 크기를 확인 =
0
당신의 목표는 당신의 목록보기가 사용할 수있는 비어 있으므로 어떤 대상과의 ShowCaseView을 만들 경우 0!
ShowcaseView.Builder showCaseViewBuild = new ShowcaseView.Builder(mActivity)
.setTarget(Target.NONE)
.[your_other_configuration_stuff_here];
한 다음 목록보기가 비어있을 때, 당신은 ListView에 계층 구조 변경에 대한 리스너를 설정할 수 있습니다 트리거하려는 경우와 같은;
ListView lv = new ListView(mActivity);
//[your ListView setup code here... then the listener below]
lv.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() {
@Override
public void onChildViewAdded(View parent, View child) {
}
@Override
public void onChildViewRemoved(View parent, View child) {
// trigger your ShowCaseView here when no children are left
// TODO
}
});
목록 크기가 0인지 확인하고 showcaseview –
을 계속 진행하면'array == null || array.isEmpty()'그런 다음 ShowCaseView를 표시하고 그렇지 않으면 listview를 표시합니다. – user392117
notifyDataSetChanged() 메서드는 어떻게 처리 할 수 있습니까? 내 경우에는 자동으로 listview를 새로 고칩니다. – Nik