Why Android is truncating my ActionBar title?

前端 未结 13 2064
Happy的楠姐
Happy的楠姐 2021-02-13 10:28

In my app, I change the title in the ActionBar from each fragment displayed. When I first start my apps, I got a list of requests, so my title is \"My requests (20)\".

T

13条回答
  •  遇见更好的自我
    2021-02-13 11:24

    I solved this problem using a custom title as described in this post.

    This is the code I use to change the title when a tab changes

    ((TextView) actionBar.getCustomView().findViewById(R.id.title)).setText(someTitle); 
    

    Note that this solution places the title to the right of the tabs in landscape mode when using actionbar tabs.

提交回复
热议问题