Bottom app bar Navigation icon is not center vertical
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
Without Option Menu
Can any one tell how to fix it?
android android-layout android-appbarlayout android-bottomnav bottombar
add a comment |
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
Without Option Menu
Can any one tell how to fix it?
android android-layout android-appbarlayout android-bottomnav bottombar
add a comment |
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
Without Option Menu
Can any one tell how to fix it?
android android-layout android-appbarlayout android-bottomnav bottombar
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
Without Option Menu
Can any one tell how to fix it?
android android-layout android-appbarlayout android-bottomnav bottombar
android android-layout android-appbarlayout android-bottomnav bottombar
edited May 14 '18 at 8:06
Muhammad Hannan
627727
627727
asked May 14 '18 at 7:43
Neeraj KumarNeeraj Kumar
464
464
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
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
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
add a comment |
You can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
add a comment |
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
add a comment |
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
You can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
add a comment |
You can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
add a comment |
You can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
You can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
answered Nov 21 '18 at 21:11
MahozadMahozad
1,64251032
1,64251032
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Jul 2 '18 at 5:53
Mohsen BeiranvandMohsen Beiranvand
369310
369310
add a comment |
add a comment |
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
add a comment |
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
add a comment |
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
edited Dec 25 '18 at 11:07
Zoe
11.2k73876
11.2k73876
answered Dec 25 '18 at 7:47
Antony AJAntony AJ
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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