How to set title in app bar with Navigation Architecture Component

前端 未结 12 2020
面向向阳花
面向向阳花 2020-12-24 11:40

I was trying out Navigation architecture component and is now having difficulties in setting the title. How do I set the title programmatically and also how it works?

<
12条回答
  •  旧时难觅i
    2020-12-24 12:37

    I would suggest to include AppBar in each screen. To avoid code duplicates, create a helper, that builds AppBar, taking the title as a parameter. Then invoke the helper in each screen class.

提交回复
热议问题