2

I am trying out newly released BottomNavigationView from android support library com.android.support:appcompat-v7:25.0.0

My assumption was menu icons will be center_vertial aligned if I don't setup menu titles but thats not happening. Below is sample screenshot.

enter image description here

Can someone point me in correct direction if its possible at all without rolling down and custom view? I am targeting following output.

enter image description here

Vipul
  • 27,808
  • 7
  • 60
  • 75
  • Please Check my answer at http://stackoverflow.com/questions/40183239/remove-bottomnavigationview-labels/40188794#40188794. I remove it using reflection. – Sanf0rd Oct 22 '16 at 05:57
  • 1
    @Sanf0rd Thanks a lot for answer! but at this moment I am not looking to use reflection approach. I think I will have to live with titles for now. – Vipul Oct 23 '16 at 05:18
  • =/. in this first releasse it is not possible. Can I answer this? – Sanf0rd Oct 23 '16 at 15:06
  • @Sanf0rd I have already up voted your answer. Thanks! – Vipul Oct 24 '16 at 16:05

4 Answers4

3

It's quite late, but you can add app:labelVisibilityMode="unlabeled" to your BottomNavigationView tag

Daniele
  • 1,063
  • 1
  • 10
  • 22
2

You can use app:labelVisibilityMode="unlabeled" to hide the labels this way the icons will be aligned to center

Rajat Das
  • 55
  • 1
  • 8
1

The space below your images is the titles' space (Empty TextView). I believe that they currently don't support an image without a text. (MenuItem must have a title, else it throws an error in xml).

MohanadMohie
  • 1,033
  • 1
  • 10
  • 17
  • 5
    I feel you explanation qualifies more of a comment than answer :). – Vipul Oct 22 '16 at 05:15
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/14795909) – demongolem Jan 05 '17 at 18:12
  • 1
    @demongolem Thank you for your review, I will take that into consideration next time I post an answer. – MohanadMohie Jan 08 '17 at 13:23
0

You can use android:paddingTop="15dp" and use android:background="@color/colorPrimary" instead of app:itemBackground="@color/colorPrimary"

Or you can use Libs like https://github.com/ittianyu/BottomNavigationViewEx

MJakhongir
  • 2,101
  • 2
  • 16
  • 27