Android custom title bar not working with android: manifest shortcut

I have a custom title bar that I would like to apply to all my actions. I searched the Internet and found several ways to do this, but I ran into a problem.

It seems that even though I have a TextView in my title with id @android: / title, Android will not use the value defined in the manifest in android: label for each action.

I tried calling setTitle (R.string.myTitle) as well, but it still won't display it! If I manually put the text in my TextView in xml, it will look fine.

How can I create a custom title bar that is bound to Android and uses Android for my shortcuts to shortcuts? I do not want to lose the setTitle () functions or XML attributes.

Thank.

+3
source share
1 answer

Try using @android:id/titleinstead @android:/title.

+1
source

Source: https://habr.com/ru/post/1769207/


All Articles