Bottom app bar Navigation icon is not center vertical












3














I'm using android.support.design.bottomappbar.BottomAppBar but the navigation icon is coming in left top corner when option menu is added.



without Option its working as expected (center_vertical).



With option menu



enter image description here



Without Option Menu



enter image description here



Can any one tell how to fix it?










share|improve this question





























    3














    I'm using android.support.design.bottomappbar.BottomAppBar but the navigation icon is coming in left top corner when option menu is added.



    without Option its working as expected (center_vertical).



    With option menu



    enter image description here



    Without Option Menu



    enter image description here



    Can any one tell how to fix it?










    share|improve this question



























      3












      3








      3







      I'm using android.support.design.bottomappbar.BottomAppBar but the navigation icon is coming in left top corner when option menu is added.



      without Option its working as expected (center_vertical).



      With option menu



      enter image description here



      Without Option Menu



      enter image description here



      Can any one tell how to fix it?










      share|improve this question















      I'm using android.support.design.bottomappbar.BottomAppBar but the navigation icon is coming in left top corner when option menu is added.



      without Option its working as expected (center_vertical).



      With option menu



      enter image description here



      Without Option Menu



      enter image description here



      Can any one tell how to fix it?







      android android-layout android-appbarlayout android-bottomnav bottombar






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 14 '18 at 8:06









      Muhammad Hannan

      627727




      627727










      asked May 14 '18 at 7:43









      Neeraj KumarNeeraj Kumar

      464




      464
























          4 Answers
          4






          active

          oldest

          votes


















          3














          After trying different ways, setting padding through styles worked.



          <style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
          <item name="android:paddingStart">10dp</item>
          <item name="android:paddingEnd">10dp</item>
          <item name="android:minWidth">10dp</item>
          </style>


          After Adding styles






          share|improve this answer





















          • Thank you for this!
            – Tgo1014
            May 15 '18 at 2:27










          • Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
            – MJonesDev
            May 20 '18 at 5:31





















          1














          You can change the BottomAppBar theme to this:



          <android.support.design.bottomappbar.BottomAppBar
          ...
          android:theme="@style/Widget.MaterialComponents.BottomAppBar"
          />





          share|improve this answer





























            0














            It's better to use Theme.MaterialComponents themes for application parent theme when you use Google Material components:



            <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">


            instead of :



            <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">


            in style.xml






            share|improve this answer





























              0














              I have also got the same issue, but found a solution by adding:



              style="@style/Widget.MaterialComponents.BottomAppBar"


              for bottomBar.






              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50325310%2fbottom-app-bar-navigation-icon-is-not-center-vertical%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                3














                After trying different ways, setting padding through styles worked.



                <style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
                <item name="android:paddingStart">10dp</item>
                <item name="android:paddingEnd">10dp</item>
                <item name="android:minWidth">10dp</item>
                </style>


                After Adding styles






                share|improve this answer





















                • Thank you for this!
                  – Tgo1014
                  May 15 '18 at 2:27










                • Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                  – MJonesDev
                  May 20 '18 at 5:31


















                3














                After trying different ways, setting padding through styles worked.



                <style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
                <item name="android:paddingStart">10dp</item>
                <item name="android:paddingEnd">10dp</item>
                <item name="android:minWidth">10dp</item>
                </style>


                After Adding styles






                share|improve this answer





















                • Thank you for this!
                  – Tgo1014
                  May 15 '18 at 2:27










                • Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                  – MJonesDev
                  May 20 '18 at 5:31
















                3












                3








                3






                After trying different ways, setting padding through styles worked.



                <style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
                <item name="android:paddingStart">10dp</item>
                <item name="android:paddingEnd">10dp</item>
                <item name="android:minWidth">10dp</item>
                </style>


                After Adding styles






                share|improve this answer












                After trying different ways, setting padding through styles worked.



                <style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
                <item name="android:paddingStart">10dp</item>
                <item name="android:paddingEnd">10dp</item>
                <item name="android:minWidth">10dp</item>
                </style>


                After Adding styles







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 14 '18 at 8:19









                Neeraj KumarNeeraj Kumar

                464




                464












                • Thank you for this!
                  – Tgo1014
                  May 15 '18 at 2:27










                • Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                  – MJonesDev
                  May 20 '18 at 5:31




















                • Thank you for this!
                  – Tgo1014
                  May 15 '18 at 2:27










                • Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                  – MJonesDev
                  May 20 '18 at 5:31


















                Thank you for this!
                – Tgo1014
                May 15 '18 at 2:27




                Thank you for this!
                – Tgo1014
                May 15 '18 at 2:27












                Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                – MJonesDev
                May 20 '18 at 5:31






                Be sure to also declare the new Material style. Declaring it directly in my XML helped me, as well as adding this. style="@style/Widget.MaterialComponents.BottomAppBar"
                – MJonesDev
                May 20 '18 at 5:31















                1














                You can change the BottomAppBar theme to this:



                <android.support.design.bottomappbar.BottomAppBar
                ...
                android:theme="@style/Widget.MaterialComponents.BottomAppBar"
                />





                share|improve this answer


























                  1














                  You can change the BottomAppBar theme to this:



                  <android.support.design.bottomappbar.BottomAppBar
                  ...
                  android:theme="@style/Widget.MaterialComponents.BottomAppBar"
                  />





                  share|improve this answer
























                    1












                    1








                    1






                    You can change the BottomAppBar theme to this:



                    <android.support.design.bottomappbar.BottomAppBar
                    ...
                    android:theme="@style/Widget.MaterialComponents.BottomAppBar"
                    />





                    share|improve this answer












                    You can change the BottomAppBar theme to this:



                    <android.support.design.bottomappbar.BottomAppBar
                    ...
                    android:theme="@style/Widget.MaterialComponents.BottomAppBar"
                    />






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 21 '18 at 21:11









                    MahozadMahozad

                    1,64251032




                    1,64251032























                        0














                        It's better to use Theme.MaterialComponents themes for application parent theme when you use Google Material components:



                        <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">


                        instead of :



                        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">


                        in style.xml






                        share|improve this answer


























                          0














                          It's better to use Theme.MaterialComponents themes for application parent theme when you use Google Material components:



                          <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">


                          instead of :



                          <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">


                          in style.xml






                          share|improve this answer
























                            0












                            0








                            0






                            It's better to use Theme.MaterialComponents themes for application parent theme when you use Google Material components:



                            <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">


                            instead of :



                            <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">


                            in style.xml






                            share|improve this answer












                            It's better to use Theme.MaterialComponents themes for application parent theme when you use Google Material components:



                            <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">


                            instead of :



                            <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">


                            in style.xml







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 2 '18 at 5:53









                            Mohsen BeiranvandMohsen Beiranvand

                            369310




                            369310























                                0














                                I have also got the same issue, but found a solution by adding:



                                style="@style/Widget.MaterialComponents.BottomAppBar"


                                for bottomBar.






                                share|improve this answer




























                                  0














                                  I have also got the same issue, but found a solution by adding:



                                  style="@style/Widget.MaterialComponents.BottomAppBar"


                                  for bottomBar.






                                  share|improve this answer


























                                    0












                                    0








                                    0






                                    I have also got the same issue, but found a solution by adding:



                                    style="@style/Widget.MaterialComponents.BottomAppBar"


                                    for bottomBar.






                                    share|improve this answer














                                    I have also got the same issue, but found a solution by adding:



                                    style="@style/Widget.MaterialComponents.BottomAppBar"


                                    for bottomBar.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Dec 25 '18 at 11:07









                                    Zoe

                                    11.2k73876




                                    11.2k73876










                                    answered Dec 25 '18 at 7:47









                                    Antony AJAntony AJ

                                    1




                                    1






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50325310%2fbottom-app-bar-navigation-icon-is-not-center-vertical%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        404 Error Contact Form 7 ajax form submitting

                                        How to know if a Active Directory user can login interactively

                                        TypeError: fit_transform() missing 1 required positional argument: 'X'