Android ActionBar Tab Color

前端 未结 6 1286
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 14:21

I have added ActionBar tabs to my application. Default color for that underline is light blue. How do I change that color or style for selected tab ?

6条回答
  •  有刺的猬
    2020-12-13 14:44

    selectableItemBackground is the attribute I think your looking for. I'd recommend you read this article about Customizing the Action Bar as well as look at this question on SO and this one as well.

    In code i cant seem to find a way to customize the individual item selected but , customizing the bar itself would look something like this.

    ActionBar bar = getActionBar();
    bar.setBackgroundDrawable(new ColorDrawable("FF0000"));
    

提交回复
热议问题