[Android,Kotlin] Fragment에서 Viewbinding 적용하기

youneeo·2023년 9월 4일
0
post-thumbnail
class firstFragment : Fragment() {
    companion object {
        fun newInstance(): firstFragment = firstFragment()
    }

    private var _binding: FragmentFirstBinding? = null

    private val binding get() = _binding!!

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        _binding = FragmentFirstBinding.inflate(inflater, container, false)
        return binding.root
    }
profile
정돈된 공간에서 생각하기를 좋아합니다.

0개의 댓글