How to inflate XML-Layout-File correctly inside Custom ViewGroup?

后端 未结 6 1652
悲&欢浪女
悲&欢浪女 2020-12-07 16:13

I want to inflate a XML-Layout-File in a custom ViewGroup Class, my Problem is that it produces just a empty screen. Doing the same in the Activity Class works fine. Here i

6条回答
  •  天命终不由人
    2020-12-07 16:58

    Try this one:

     LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
     inflater.inflate( R.layout.login_view_layout, null );
    

提交回复
热议问题