/** * 移除长按点击弹出Toast */ fun BottomNavigationView.removeLongTouchToast() { val bottomNavigationMenuView = this.getChildAt(0) as ViewGroup val size = bottomNavigationMenuView.childCount for (index in 0 until size) { bottomNavigationMenuView[index].setOnLongClickListener { true } } }
真机测试有效,夜神模拟器无效