0

My app has 3 tabs and on one of the tabs I replace the spinner with the toolbar's title so I set the title to null and set the spinner visibility to visible, but I want the spinner's selected item's style to be coherent with the other tabs titles style in color, padding, font size, etc.(the toolbar's title style is the default style)

Is there any way to achieve this?
currently, my app looks like: enter image description hereenter image description here

λambduh
  • 85
  • 8
  • @HenryTwist Ok but how do I know the toolbar's title default style? – λambduh Jul 22 '21 at 11:58
  • @MikeM. Yes exactly, so I have to setTextAppearnace of the view to R.attr.titleTextStyle? but the method takes only style type. – λambduh Jul 22 '21 at 12:08
  • @MikeM. Well I tried that but the font becomes weirdly too small :( – λambduh Jul 22 '21 at 12:38
  • Oh, wait, hang on. I just realized where I screwed up. `titleTextStyle` is not a theme attribute; it's an `ActionBar` attribute. That's my bad. If you've still got the setup from that suggested fix, we should just need to change to specify the style instead; e.g., `android:textAppearance= "@style/TextAppearance.AppCompat.Widget.ActionBar.Title"`, if using support/androidx. You might give that a shot. – Mike M. Jul 22 '21 at 13:24
  • I should mention, too, that that one could be done in code with a single `setTextAppearance(R.style.TextAppearance...)` call, since we wouldn't have to resolve an attribute value. – Mike M. Jul 22 '21 at 13:48
  • 1
    @MikeM. Yes that was the case. I found that on [this post](https://stackoverflow.com/questions/26577528/android-toolbar-style) and it solved my problem. Thank you very much. – λambduh Jul 22 '21 at 15:07

0 Answers0