記錄一下本應用《任您記)APP項目中點擊底部導覽列四個按鈕,則介面顏色跟著變化及表徵圖字放大效果

來源:互聯網
上載者:User

標籤:底部導覽列   -o   mpi   用法   一個   RoCE   lse   tco   導覽列   

底部導覽列四個按鈕代表四個顏色,點其中其中一個按鈕,則換一種顏色,顏色代碼和表徵圖都儲存在相應的數組裡,具體如下:

使用的開源庫是:LuseenBottomNavigation
本應用《任您記)APP項目中用法是依賴:compile ‘com.github.armcha:LuseenBottomNavigation:1.8.2‘

主要代碼:

if (bottomNavigationView != null) {
bottomNavigationView.isWithText(false);
bottomNavigationView.isColoredBackground(true);
bottomNavigationView.setTextActiveSize(getResources().getDimension(R.dimen.dp_18));
bottomNavigationView.setTextInactiveSize(getResources().getDimension(R.dimen.dp_18));
bottomNavigationView.setItemActiveColorWithoutColoredBackground(ContextCompat.getColor(this, R.color.colorPrimary));
bottomNavigationView.setFont(Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/chinese_character.ttf"));
}

    BottomNavigationItem bottomNavigationItem = new BottomNavigationItem            ("待辦", color[0], image[0]);    BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem            ("日記", color[1], image[1]);    BottomNavigationItem bottomNavigationItem2 = new BottomNavigationItem            ("賬單", color[2], image[2]);    BottomNavigationItem bottomNavigationItem3 = new BottomNavigationItem            ("紀念日", color[3], image[3]);    bottomNavigationView.addTab(bottomNavigationItem);    bottomNavigationView.addTab(bottomNavigationItem1);    bottomNavigationView.addTab(bottomNavigationItem2);    bottomNavigationView.addTab(bottomNavigationItem3);    bottomNavigationView.setOnBottomNavigationItemClickListener(this);

最後上一下已做好的優雅介面圖:

記錄一下本應用《任您記)APP項目中點擊底部導覽列四個按鈕,則介面顏色跟著變化及表徵圖字放大效果

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.