Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:12:20+00:00 2026-06-17T07:12:20+00:00

I am currently using a custom layout for my MenuItem: The code is basic:

  • 0

I am currently using a custom layout for my MenuItem:

enter image description here

The code is basic:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/menu_custom"
        android:actionLayout="@layout/menu_layout"
        android:showAsAction="always"/>

</menu>

While the icon size in pixel is described in the Android Design and Guidelines, I have no idea at the margin, padding, width and height I should use for this icon, so it will look legit on all devices.

My current layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/searchProgressWrapper"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >


    <ImageButton
        android:id="@+id/ivfolder"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:scaleType="fitCenter"
        android:background="@drawable/abs__item_background_holo_dark"
        android:src="@drawable/ic_menu_archive" />


</RelativeLayout>

The big problem, is that as you can see, the width of the icon is totally wrong and is not similar at all to other MenuItems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:12:21+00:00Added an answer on June 17, 2026 at 7:12 am

    android:minWidth should be 56dip, android:paddingBottom and android:paddingTop should be 8dip. Found in <sdk>/platforms/android-17/data/res/values/dimens.xml:

    <!-- Minimum width for an action button in the menu area of an action bar -->
    <dimen name="action_button_min_width">56dip</dimen>
    
    <!-- Vertical padding around action bar icons. -->
    <dimen name="action_bar_icon_vertical_padding">8dip</dimen>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on android project where I am using a custom list
I am using wordpress latest version. Currently my blog is set to custom permalink
I currently using android NDK to write some native code in C. I have
I am currently using the custom layout for the child in Expandablelist which includes
I am currently ordering a list of custom objects using the IQueryable OrderBy method
I want to add traffic information to my custom map. Currently I'm using a
Currently using MySQL version 5.1.6 This is my first real world build and so
I'm trying to use custom notifications in my Android application using Google's sample from
I'm using Twitter's Bootstrap library, version 2.0.3 to prototype a website. I'm currently using
I am new to android/java and currently am trying to learn custom events and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.