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

Navigation Drawer does not responds to swipe gesture

I want to implement a navigation drawer in my app and I have implement it by referring android developer's guide android developer's guide to navigation drawer. but the problem is that when I opened the app the drawer is not getting closed.it…
0
votes
2 answers

set textcolor of tab

why am I not able to set the textcolor of the tablayout? Here is the whole xml-source. The relevant line is: app:tabTextColor="@color/tabTextColor" The text is not white - its black And here is the whole source coude
java
  • 1,165
  • 1
  • 25
  • 50
0
votes
1 answer

Tabs in CollapsingToolbarLayout overlapping RecyclerView

I have a TabLayout which has a ViewPager that selects between two fragments which both have vertical scrolling RecyclerViews. I have a scrolling TabLayout so that when I scroll the RecyclerView, the tabs disappear. However, it starts off with the…
0
votes
2 answers

How to change dynamically TextView and ImageView Elements for each Fragment

Background I am trying to populate fragments' contents through one function. The fragment list changes according to the Navigation Item Selected. IE: I have 2 Navigation items ("Fruits,Animals") for both, I have 3 categories where the thing that…
Sgdva
  • 2,800
  • 3
  • 17
  • 28
0
votes
1 answer

How to Create a custom tab layout that mimics the default tab text

I need to create a custom tab layout, but I want the text to mimic the style used in the normal TabLayout.TabView. To do that, I've set my text appearance to TextAppearance.Design.Tab. If you take a look at TabLayout itself, you can see that's what…
Andrew
  • 20,756
  • 32
  • 99
  • 177
0
votes
0 answers

Skip tab in tablayout

I need to skip particular tab. When user scroll from 1st to 2nd tab control should move to 3rd tab and vice versa. I have override the OnTabSelectedListener for Tablayout and calling below function in tabselected method, but no result. private…
Manukumar
  • 381
  • 1
  • 4
  • 11
0
votes
1 answer

Android TabLayout start activity on the second tab

I've got a default Tabbed Activity in Android which has standard "Section 1", "Section 2" and "Section 3" tabs. When the app runs, it starts at tab 1, and I wanted to know how to make it start at tab 2 (the middle one). Some solutions that I've seen…
Evgeny
  • 107
  • 3
  • 17
0
votes
1 answer

What is the lifecycle of tabs, when switching between Tabs in TabLayout

I have five tabs in Tablayout with fragments. I have a Floating button at the Bottom right corner of the first Tab. when I click the FAB button, it inflates a small CardView(Initially Cardview was set to INVISIBLE), and when I click FAB button…
0
votes
1 answer

image inside appbar layout

I am making a tabbed activity. I have placed an image view inside AppBarLayout. I want to change image view src or background when each tab is selected. Any body give me some hint? I have attached my code below.…
Mohammad Aamir
  • 471
  • 2
  • 5
  • 14
0
votes
1 answer

Selected tab not being passed through to fragment in tablayout

In a simple tabLayout view viewPager setup I am unable to correctly pass through the selected tab to the fragment within it. As tabs are selected left to right (i.e tab 1 -> tab x) the tab is correctly interpreted, but as they are selected right to…
0
votes
2 answers

Open particular tab on click of imageview

I have used multiple tab layout activities (ex.5) & multiple image view (ex:5 ).i click (Ex:3) image then open particular tab (Ex:3). how to write code anybody help.Image used in main activity image click enter tab layout particular tab.
Nm Sankar
  • 41
  • 1
  • 7
0
votes
1 answer

Button overlaps TabLayout in ConstraintLayout

In Constraintlayout i am using guideline to show tablayout and a view, tablayout covers 10% and view covers rest of 90% of screen. On tab click i want to show some buttons coming from bottom to 55% of screen for which i am using another guideline…
0
votes
1 answer

How can I change tab layout icon size ?

I want to change my tab layout icon size. But my icons selected and unselected. How can I do this ? How can I change image size ? My aim is :When I change the tab selected and unselected icons will change. I did it. But Icons size are so small. How…
podgradle
  • 336
  • 1
  • 10
  • 17
0
votes
1 answer

position value of tab selected while switching one tab to another is not changing in android tabLayout

while switching tabs in tablayout position value tab is not changing.see the code below. tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { …
vinay
  • 149
  • 7
0
votes
1 answer

TabLayout covered content in fragments

I recently added a TabLayout wrapped in an AppBarLayout that previously contains the toolbar, but now the fragments hosted by the TabLayout, which should be beneath it, got covered by the TabLayout, I have tried adding…
1 2 3
99
100