버튼이있는 Fragment가 있습니다. 조각을 만들 때 조각에서 UiSettings 인스턴스를 가져 와서 단추를 표시할지 여부를 변경하려고합니다. 아이디어는 here으로 볼 수 있습니다. 그래서 내 코드는 다음과 같습니다뷰 상태 설정 구현
class MyFragment extends Fragment{
private Button button;
private UiSettings settings;
public getUiSettings(){
return settings;
}
}
class UiSettings{
private boolean showButton = true;
//setters and getters go here
}
내 질문은 어떻게은 UiSettings에 따라 버튼의 가시성을 유발하고, 어떻게은 UiSettings의 변화에 버튼 가시성 상태를 연결해야합니까?
우리에게 환경 설정 레이아웃을 지정? –
@Flextra 기본 레이아웃이 없습니다. 아이디어를 얻으려면 위의 링크를 따르십시오. –
도움이 될 만한가요? http://stackoverflow.com/questions/17549908/android-google-api-failed-to-load-map-fixed –