0

I want to get a view of the second tab in the tab layout.

not Fragment's view in ViewPager.

I'm using TakuSemba's Spotlight Library.

I want spotlight to 2nd Tab.

But I can't get View of 2nd Tab in Tablayout.

How can I get a View of Tab?

EDIT :

 TextView tab_mypage= (TextView) LayoutInflater.from(this).inflate(R.layout.tab_item, null);
 tab_mypage.setText(R.string.tab_menu_mypage);
 tab_mypage.setTextColor(ContextCompat.getColor(this, R.color.font_color_1));

 Drawable drawable_mypage = getResources().getDrawable(R.drawable.ic_mypage_24);
 DrawableCompat.setTint(drawable_mypage, ContextCompat.getColor(this, R.color.font_color_1));
 tab_mypage.setCompoundDrawablesWithIntrinsicBounds(null, drawable_mypage, null, null);
 tabLayout.getTabAt(1).setCustomView(tab_mypage);
01hanst
  • 577
  • 6
  • 19

1 Answers1

0

You can get like this.

tabLayout.getTabAt(0).getCustomView()
Parth Suthar
  • 123
  • 4