Skip to content

13장 Todo 리스트, 405페이지: FAB visibility 오류 #5

@experien

Description

@experien

13장, 405페이지
EditActivity.kt

insertMode() {
    deleteFab.visibility = View.GONE
    ....
}

오류 메시지:
VisibilityAwareImageButton.setVisibility can only be called from within the same library group (groupId=com.android.support) less... (Ctrl+F1)
This API has been flagged with a restriction that has not been met. Examples of API restrictions: * Method can only be invoked by a subclass * Method can only be accessed from within the same library (defined by the Gradle library group id) * Method can only be accessed from tests. You can add your own API restrictions with the @RestrictTo annotation. Issue id: RestrictedApi

검색 결과:
https://stackoverflow.com/questions/50343634/android-p-visibilityawareimagebutton-setvisibility-can-only-be-called-from-the-s

fab에 setVisibility() 가 안 먹네요. 편집창에서는 오류를 보여주는데 빌드는 잘 됩니다;;
해결은 간단히 했습니다만 원인은 잘 모르겠습니다. import 문제인지?

해결:

insertMode() {
    //deleteFab.visibility = View.GONE
    deleteFab.hide()
    ...
}

사족) 책 구성이 아주 세심합니다. 도움이 많이 되었습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions