Tabs without icon

前端 未结 5 664
悲&欢浪女
悲&欢浪女 2020-12-18 22:39

I\'m having a look at the \"Tab Layout\" tutorial which is perfectly clear and my question is very simple : is it possible to create tabs with no icon, just a single title?<

5条回答
  •  不知归路
    2020-12-18 22:56

    I guess you are reading Tab layout tutorial There you can see that they use following function to set title and icon:

    setIndicator("Albums",res.getDrawable(R.drawable.ic_tab_albums))

    Same function has another version, which does not take drawable as parameter

    .setIndicator("Albums")

    So, this second version of the function creates tab without icon. Simple answer - yes, you can create tabs with title only.

提交回复
热议问题