How to specify id when uses include in layout xml file

前端 未结 11 2623
挽巷
挽巷 2020-12-02 08:55

In my layout xml file, I have included other layout xml file (each with a different android id).



        
11条回答
  •  囚心锁ツ
    2020-12-02 09:36

    yes is like this, but careful when the layout inserted in include field is a custom one and you want to access that root layout. That layout in this case @layout/test test, is actually returned in first line.

    test test1View = (test)findViewById(R.id.test1);
    

提交回复
热议问题