-1

I want to Place an Image instead of an Text which is Shown in return Statement

  @Override
            public CharSequence getPageTitle(int position) {

                switch (position) {
                    case 0:
                        return "Personal Information";
                    case 1:
                        return "Address Infromation";
                    case 2:
                        return "Qualification";
                    case 3:
                        return "Work Experience";
                }
                return null;
            }

1 Answers1

0

You have to use setIcon() in the place of string like,

tabLayout.getTabAt(i).setIcon(R.id.ic_tab_contacts);

in your case method might look like,

@Override
            public int getPageTitle(int position) {

                switch (position) {
                    case 0:
                        return R.id.ic_tab_contacts;
                    case 1:
                        return R.id.ic_tab_profile;
                    case 2:
                        return R.id.ic_tab_Call;
                    case 3:
                        return R.id.ic_tab_message;
                }
                return null;
            }
Nirav Madariya
  • 1,470
  • 2
  • 24
  • 37