Setting Action Bar title and subtitle

后端 未结 12 738
盖世英雄少女心
盖世英雄少女心 2020-12-01 02:41

I want to set title and subtitile of my action bar before compile time. I got a way to do it like this:

ActionBar ab = getActionBar();
ab.setTitle(\"My Title         


        
12条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 03:08

    This is trivial one-liner in Kotlin

    supportActionBar?.title = getString(R.string.coolTitle)

提交回复
热议问题