나는 그룹 ExpandableListView 청취자를 축소 및 확장이 : 위에서 볼 수 있듯이 그룹이 확장 될 때텍스트보기의 서체를 Typeface.NORMAL에 설정해도 아무런 영향이 없으며 그 이유는 무엇입니까?
// There is a text view on group layout, no problem there.
@Override
public void onGroupCollapse(int groupPosition) {
// this callback is triggered, however, once the textView is BOLD by onGroupExpanded, the textView is not set back to normal, seems this line of code does nothing...WHY?
textView.setTypeface(textView.getTypeface(), Typeface.NORMAL);
}
@Override
public void onGroupExpand(int groupPosition) {
// it works fine
textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
}
, 내가, 그룹 레이아웃에 textView
이 굵은textView
, 붕괴 경우, I 언 브로드으로 Typeface.NORMAL
으로 다시 설정하십시오. textView
이 onGroupCollapse(...)
이 이후 트리거 될 때 textView
하지 NORMAL로 다시 설정, onGroupExpanded(...)
콜백에 의해 BOLD 되면
두 콜백은, 그러나, 제대로 트리거됩니다. onGroupCollapsed(...)
에있는 코드 줄은 아무 것도하지 않습니다 ... 왜?
이 (다시, onGroupCollapse(...)
가 트리거가 문제가 없습니다.!)
시도'textView.setTypeface (null의, Typeface.NORMAL),'어떻게 보는가 ? – donfuxx
@donfuxx, 내가 제안한 변경을 한 후에 작동합니다. 하지만 제 코드에 그 문제가있는 이유를 설명해 주시겠습니까? 첫 번째 매개 변수가 문제를 해결할 때 null을 사용하는 이유는 무엇입니까? – Leem
나는 내 대답 ;-)에서 설명하려고 노력했다. setTypeface 메소드가 실제로 직관적이지 않고 때로는 혼란 스럽다 .-P – donfuxx