Questions tagged [android-tablayout]

Android TabLayout provides a layout to organize pages of information.

TabLayout provides a horizontal layout to display tabs.

Population of the tabs to display is done through TabLayout.Tab instances. You create tabs via newTab(). From there you can change the tab's label or icon via setText(int) and setIcon(int) respectively. To display the tab, you need to add it to the layout via one of the addTab(Tab) methods.

Useful links

2044 questions
0
votes
1 answer

Titles in TabLayout donsen't appear

guys I have a trouble in Android, my code compiles and but not work all fine! I try to do a TabLayout with ViewPager but the text donsen't appear. This is the structure of the code: I build this based on DrawableLayout own created by Android…
user9743076
0
votes
0 answers

Base.Widget.Design.TabLayout does not work as a parent in style.xml in android

I searched google but can not find solution.I need to define different styles for Tablayout for themes.I figure it out how to include my Toolbar style but can not make it work because of Base.Widget.Design.TabLayout.When I define it as a name it…
Gulshan
  • 61
  • 1
  • 10
0
votes
1 answer

Tablayout doesn't show tab title at the bottom of viewpager

I'm new to android and would really appreciate some help. I'm trying to show tabs at the bottom of my ViewPager. But the issue is that the TabLayout shows up without any text. This is what I wrote inside UploadActivity.java class public class…
ashhad
  • 163
  • 1
  • 7
  • 18
0
votes
2 answers

Nested fragment improper layout inflation in TabLayout

So I have a main_activity with DrawerLayout. This activity has FrameLayout which is inflated with the layout of fragment_forecast. Fragment_forecast has TabLayoutwhich holds three other fragments. All of this child fragment layouts overlap tabs of…
dawzaw
  • 419
  • 6
  • 17
0
votes
1 answer

Navigation drawer with TabLayout

I am tyring to make a time table . In which Navigation drawer will show days and tab bar will show timing wise lunch, dinner, breakfast. Question : How to make conditions such that we get to know about both the selected navigation drawer item and…
0
votes
2 answers

How to return multiple fragments from FragmentPagerAdapter

If I use a TabLayout with FragmentPagerAdapter, the overridden function getItem(int position) just return one fragment. In case of lager screen I would like to have 2 fragments to be returned. How can I do it? should wrap these 2 fragments into one…
0
votes
2 answers

How to swipe ViewPager while the content is being scrolled?

I am able to implement TabLayout with ViewPager nicely but when the content inside the ViewPager is being scrolled (the deceleration animation), I cannot swipe left and right to change to other fragments inside ViewPager. I have to wait until the…
Aung
  • 253
  • 1
  • 5
  • 15
0
votes
0 answers

Android fill tab layout with mysql json data

I have spent so many days searching, but couldn't find a helpful tutorial on how to fill tab layout with MYSQL JSON data. There is so many tutorials available for tab layout but nothing for MYSQL JSON in particular. Can anyone help me on this…
pth
  • 11
  • 1
0
votes
0 answers

Android ViewPager not swiping

My app contains tabs and a ScrollView. When I run it on a device, I can switch inbetween tabs by tapping and scroll up/down with no problem. However, the swiping horizontally (between tabs) doesn't seem to work. My guess is that there is a conflict…
0
votes
3 answers

call popBackStack result more than one times of onBackPressed

My app has this flow Activity (TabLayout) -> Fragment 1 -> Fragment 2 -> Fragment 3 When I either press back on Fragment 2 or Fragment 3, I already go back to Fragment 1. I want to go back to Fragment 2 if I am on Fragment 3. From fragment 1 to…
Pak Ho Cheung
  • 1,382
  • 6
  • 22
  • 52
0
votes
1 answer

Tablayout Items Dissappears when added with ViewPager

I know this is an already asked Question and whenever i searched for these questions, i got static no of tabs and fragments. i am trying to implement the same logic in a dynamic way. that is, items in my tab are populated from an arraylist. …
rituparna
  • 91
  • 1
  • 12
0
votes
3 answers

change Custom Tab layout Textview background color

I want to Change Background Color of custom Tab. I have Textview in Custom Tab.I tried Following code But Textveiw background color not changed. final TextView tabText_customtab1=(TextView)findViewById(R.id.tabText_customtab1); final…
ajay dhadhal
  • 306
  • 4
  • 16
0
votes
0 answers

using nested fragments or changing tablayout adapter

i have this interface in my app by choosing each item in bottomNavigation , the tab layout will change my question is should i make a fragment for each of the bottom navigation items and then put the tab layouts inside that fragments ? or make…
0
votes
1 answer

Implementing interface from Tablayout Fragment ( Android)

i'm not sure this is the perfect title for this but its the best i could come up with. I have a java class ApiRequest the runs some http requests and returns the result in a callback via an interface. Example will be the authenticate method…
Mueyiwa Moses Ikomi
  • 1,069
  • 2
  • 12
  • 26
0
votes
1 answer

Unable to swap between fragments and text is not shown either in tablayout

I have used view pager and and Tablayout for tabbed activity.clicking on the tab is changing but the issue is that I unable to swap between the fragments, and the text in the fragment is not shown. Using tabLayout.setupWithViewPager(viewPager);is…