Google's Android Sliding Tabs Layout

前端 未结 3 828
面向向阳花
面向向阳花 2021-01-25 21:46

I have successfully used Google\'s Sliding Tabs code in my project. (Sample project can be found here: http://developer.android.com/samples/SlidingTabsBasic/index.html) This is

相关标签:
3条回答
  • 2021-01-25 22:20

    set this property as true in SlidingTabLayout

     mSlidingTabLayout.setDistributeEvenly(true);
    
    0 讨论(0)
  • 2021-01-25 22:38

    You probably find the setDistributeEvenly method cannot be resolved if you use the sample code from

    http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html

    Then in the createDefaultTabView method of your SlidingTabLayout class, add the following line before returning the textView

    textView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1.0f));
    
    0 讨论(0)
  • 2021-01-25 22:44

    Use Google IO SlidingTabLayout and SlidingTabStrip and call setDistributeEvenly(true) and it will create the same layout as the youtube one

    0 讨论(0)
提交回复
热议问题