Warning: This can be replaced with a tag

前端 未结 4 1947
陌清茗
陌清茗 2021-02-05 08:58

I have a FrameLayout that contains a TextView and two LinearLayouts:



        
4条回答
  •  执笔经年
    2021-02-05 09:19

    Are you using this as the main layout of your activity? If so, you can replace it with a merge tag like this:

    
    
        ... a textview and 2 linearlayouts
    
    
    
    

    At setContentView, Android will take the children of the merge tag and directly insert them to the FrameLayout with @android:id/content. Examine both approaches (FrameLayout vs merge) with HierarachyViewer to see the difference.

提交回复
热议问题