GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wintonBy/BottomNavigationView: 🔥一个简单的底部导航栏,可以快速集成,简单易用,提供自定义属性,以及默认属性等

BranchesTags
Open more actions menu

Latest commit

 

History

58 Commits
58 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
bottomnavigationview
bottomnavigationview
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
README.md
README.md
 
 
bintray.gradle
bintray.gradle
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
jitpack.yml
jitpack.yml
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

简介

一个简单的底部导航栏,可以快速集成,简单易用  

问题反馈

  欢迎大家加入群组讨论。 Coder
qq_img

使用效果


整体效果


默认


无分割线


自定义线

集成方式

gradle

Step 1. Add the dependency

dependencies {
    implementation 'com.winton:bottomnavigationview:1.0.0'
}

用法

XML布局

    <com.winton.bottomnavigationview.NavigationView
        app:layout_constraintBottom_toBottomOf="parent"
        android:id="@+id/nv"
        android:background="@android:color/white"
        app:activeTextColor="@android:color/black"
        app:unactiveTextColor="#666666"
        android:layout_width="match_parent"
        android:layout_height="60dp">
    </com.winton.bottomnavigationview.NavigationView>

添加module

 NavigationView mNV = findViewById(R.id.nv);
        List<NavigationView.Model> tabs = new ArrayList<>();
        tabs.add(new NavigationView.Model.Builder(R.mipmap.ic_launcher,R.mipmap.ic_launcher).title("主页").build());
        tabs.add(new NavigationView.Model.Builder(R.mipmap.ic_launcher,R.mipmap.ic_launcher).title("tab1").build());
        tabs.add(new NavigationView.Model.Builder(R.mipmap.ic_launcher,R.mipmap.ic_launcher).title("tab2").build());
        mNV.setItems(tabs);
        /*在此处监听,可获取到第一次选中到结果*/
        mNV.build();
        //mNV.check(0); //2.2 版本之后默认选中0

添加监听

mNV.setOnTabSelectedListener(new NavigationView.OnTabSelectedListener() {
            @Override
            public void selected(int i, NavigationView.Model model) {
                Toast.makeText(MainActivity.this,model.getTitle(),Toast.LENGTH_LONG).show();
            }

            @Override
            public void unselected(int i, NavigationView.Model model) {

            }
 });

显示新消息

 /**
 * 第一个参数代表Item的位置
 * 第二个参数代表是否显示红点
 * 第三个参数代表红点第内容
 **/
 mNV.reminder(0,true,"99");
 mNV.reminder(1,true,"···");
 mNV.reminder(2,true,"");

参数说明

  • app:iconSize     图标大小
  • app:textSize     文字大小
  • app:activeTextColor     选中时文字颜色
  • app:unactiveTextColor     未选中时文字颜色
  • app:icon_margin_top     距离顶部的距离
  • app:text_margin_bottom     距离底部的距离
  • app:lineColor     分割线到颜色
  • app:showLine    是否显示风割线
  • License

    Copyright 2018 Winton

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    About

    🔥一个简单的底部导航栏,可以快速集成,简单易用,提供自定义属性,以及默认属性等

    Resources

    Readme
    Activity

    Stars

    92 stars

    Watchers

    4 watching

    Forks

    10 forks
    Report repository

    Releases

    Packages

    Used by

    Contributors

    Languages

    You are visitor 01402792 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.