Skip to content

wanliyang1990/NavigationBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NavigationBar

标题导航栏,两三句代码即可实现

XML布局:

    <com.ywl5320.navigationbar.bar.NavitationLayout
        android:id="@+id/bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#ffffff"/>

<com.ywl5320.navigationbar.bar.NavitationFollowScrollLayout
        android:id="@+id/bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#ffffff"/>

实例图片:
image
NavitationFollowScrollLayout初始化选择指定标题位置:
image

更多实例图片:

update:

image

1、

image
代码如下:

    /**
     *
     * @param context 上下文
     * @param titles 标题栏
     * @param viewPager
     * @param unselectedcolor 未选中字体颜色
     * @param setectedcolor 选中字体颜色
     * @param txtUnselectedSize 未选中字体大小
     * @param txtSelectedSize 选中字体大小
     * @param currentPosition 当前viewpager的位置
     * @param widOffset 导航条的边距
     * @param smoothScroll 滑动类型
     */
    navitationLayout.setViewPager(this, titles, viewPager, R.color.color_333333, R.color.color_2581ff, 16, 16, 0, 0, true);
    navitationLayout.setNavLine(this, 3, R.color.colorPrimary, 0);

2、

image
代码如下:

    navitationLayout.setViewPager(this, titles, viewPager, R.color.color_333333, R.color.color_2581ff, 16, 16, 0, 0, true);
    navitationLayout.setBgLine(this, 1, R.color.colorAccent);
    navitationLayout.setNavLine(this, 3, R.color.colorPrimary, 0);

3、

image
代码如下:

    navitationLayout.setViewPager(this, titles, viewPager, R.color.color_333333, R.color.color_2581ff, 16, 16, 0, 12, true);
    navitationLayout.setBgLine(this, 1, R.color.colorAccent);
    navitationLayout.setNavLine(this, 3, R.color.colorPrimary, 0);

4、

image
代码如下:

    navitationLayout.setViewPager(this, titles, viewPager, R.color.color_333333, R.color.color_2581ff, 14, 18, 0, 12, true);
    navitationLayout.setBgLine(this, 1, R.color.colorAccent);
    navitationLayout.setNavLine(this, 3, R.color.colorPrimary, 0);<br/>

5、

image 代码如下:

    navitationLayout.setViewPager(this, titles, viewPager, R.color.color_333333, R.color.color_2581ff, 16, 16, 0, 12, true, R.color.color_333333, 1f, 15f, 15f);
    navitationLayout.setBgLine(this, 1, R.color.colorAccent);
    navitationLayout.setNavLine(this, 3, R.color.colorPrimary, 0);

create by ywl5320

About

标题导航栏,两三句代码即可实现

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages