강의

멘토링

커뮤니티

Inflearn Community Q&A

ch1124ki3848's profile image
ch1124ki3848

asked

Kotlin-based Android app development advanced level 2

Activity Controller

Fragment에서는 왜 컨트롤 바로 접근이 안되나요?

Written on

·

317

0

import kotlinx.android.synthetic.main.fragment_input.*

위에꺼 추가해서 button이 바로  코드 상에서는 보이고 잘되는데  실행하면 에러가 나네요.

Fragment에서는 inflate한 다음에 findViewById를 반듯이 써야 하나요? 바로 button컨트롤에 접근 안되나요?

androidkotlin

Answer 1

1

softcampus님의 프로필 이미지
softcampus
Instructor

findViewById를 그냥 사용하는 것은 Activity 내부에서만 가능합니다.

ch1124ki3848's profile image
ch1124ki3848

asked

Ask a question