findViewById returns null on a LinearLayout inside an d view

前端 未结 2 809
日久生厌
日久生厌 2020-12-03 22:07

I cannot figure out mistake here. I may be oevrlooking some thing...

Layout XML:



        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 22:32

    try this:

    View v = getlayoutInflater().inflate(((LinearLayout)findViewById(R.id.headerInclude)), null);
    TextView tvTitle = (TextView)  v.findViewById(R.id.tvScreenTitle);
    

提交回复
热议问题