dividers between TabWidgets

前端 未结 5 1688
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 03:54

Is the android:divider attribute under the TabWidget working? I tried the Tab Layout tutorial from android just to test (http://developer.android.com/resources/tutorials/vi

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 04:37

    It doesn't look like the divider attribute is available anymore for TabWidget. One way to add a custom divider is to set it programmatically:

    mTabHost.getTabWidget().setDividerDrawable(R.drawable.divider_vertical_dark);
    

    Make sure however, you call this before you set the content of the tabs. It would crash on me if I called it after.

提交回复
热议问题