Android - 如何动态更改底部导航高度

时间:2021-02-28 02:24:55

标签: java android kotlin mobile bottomnavigationview

我想动态改变BottomNavigationView的大小。我想要那个;

enter image description here

以下代码有效;

 bottomnNavigation.layoutParams.height = bottomnNavigation.height - 1
 bottomnNavigation.requestLayout()

但它并不完全符合我的要求;

enter image description here

另外,如果“高度”是一个像 123 这样的数字,我如何以 100 步减少它?

123 / 100 = 1,23

但是 height 不适用于 float,它适用于 int。

0 个答案:

没有答案