I have to create one Toolbar for each activity in my Android app?

前端 未结 3 2108
我在风中等你
我在风中等你 2021-02-14 19:35

I have this doubt about new Toolbar in Android.

I have to create one Toolbar for each activity in my app or there are a best practice to create one Toolbar for all activ

3条回答
  •  别跟我提以往
    2021-02-14 20:02

    Toolbar is just a view and you have to add it to your each Activity in which you want to show it.

    One way is to just put it in a separate layout file and include in your Activity layout.

    toolbar.xml

    
    
    
    
    

    Now in your Activity layout where you want to add it just include like this:

    
    

提交回复
热议问题