last day (14 days later) » 

10:35 AM
1
A: Titles in tablayout aren't visible

jaydroider This will do Trick for you. Add your Tab Layout in Runnable. tabLayout.post(new Runnable() { @Override public void run() { tabLayout.setupWithViewPager(viewPager); } });

 
I did try this trick a while ago it wasn't working
 
@ZeeshanShabbir Can you show me your Gradle ? please post it in above Question.
 
I have posted it
 
@ZeeshanShabbir I think it may be bug in design com.android.support:design:23.3.0 . have you tried using downgrade version for this like com.android.support:design:22.2.0 this works currently for me.
 
ok i will try it in some time then will let you know
this doesn't work i have downgraded the version
now titles are showing but scroll isn't smooth i have to scroll twice to switch to new tab
 
10:35 AM
@ZeeshanShabbir For that their is something wrong with View Pager itself try to crosscheck that. and appreciate my answer if it's helpful to you thanks :) I will edit my answer for downgrade version..
 
actually your answer wasn't the solution. I am working with latest support design library and i need to make some changes in xml in order make this work but now problem is with scroll. i appreciate that you put some efforts to help me out.
 
@ZeeshanShabbir Yes i know it is not but i am looking into scroll isn't smooth. and for design support only you can use downgrade version because i have read somewhere it's defined as bug what you have in your OP. so i have to give that solution.
@ZeeshanShabbir For view pager smooth scroll try by adding this myPager.setOffscreenPageLimit(1);.
 
doesn't work either. If i downgrade the lib then i get lots of error sine my target sdk is 23
 
@ZeeshanShabbir Let me know brother for my knowledge if you get any other alternate solution for this. i have tried with what all i know.
 
I find myself stuck here
let me test it with lower sdk
```
```

package com.softoven.ultron.activities;

import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
can you review the above code see if there is something which is causing this problem?
 

last day (14 days later) »