# Android-FlexibleUnderlinePageIndicator **Repository Path**: bakerj/Android-FlexibleUnderlinePageIndicator ## Basic Information - **Project Name**: Android-FlexibleUnderlinePageIndicator - **Description**: 适应tab宽度的ViewPage指示器 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: https://github.com/BakerJQ/Android-FlexibleUnderlinePageIndicator - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2017-07-28 - **Last Updated**: 2022-11-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FlexibleUnderlinePageIndicator Android PageIndicator fits irregular size & position of tabs for a ViewPager ## Screenshot ![](https://raw.githubusercontent.com/BakerJQ/Android-FlexibleUnderlinePageIndicator/master/Screenshots/show.gif) ## How to use ### XML ```xml ``` ### Java code ```java View tab1 = findViewById(R.id.tab1); View tab2 = findViewById(R.id.tab2); View tab3 = findViewById(R.id.tab3); View tab4 = findViewById(R.id.tab4); FlexibleUnderlinePageIndicator indicator = (FlexibleUnderlinePageIndicator) findViewById(R.id.indicator); ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); viewPager.setAdapter(new SimplePageAdapter(this)); //set the viewpager and tabs indicator.setUnderLineView(tab1, tab2, tab3, tab4); indicator.setViewPager(viewPager); ```