add layout as a view in Android

前端 未结 3 1464
清歌不尽
清歌不尽 2021-02-20 02:44

I have a pretty complex layout defined in xml file , now I want to add this layout as a view using addView or something else.

As layout is pret

3条回答
  •  鱼传尺愫
    2021-02-20 03:15

    U can also reduce this to oneline code;

      View view = View.inflate(getActivity, R.layout.my_layout,null);
    

    then add to your view.

提交回复
热议问题