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

  • Home
  • SEARCH
  • 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 8821167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:47:08+00:00 2026-06-14T05:47:08+00:00

<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=fill_parent android:layout_height=fill_parent android:gravity=center android:orientation=vertical android:padding=6dp android:weightSum=1.0 > <Button android:id=@+id/btnCreateNewMonth android:layout_width=fill_parent android:layout_height=fill_parent

  • 0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="6dp"
android:weightSum="1.0" >

<Button
    android:id="@+id/btnCreateNewMonth"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_vertical|center"
    android:layout_weight="0.5"
    android:onClick="btnCreateNewMonth_clickHandler"
    android:paddingBottom="5dp"
    android:text="@string/btn_create_new_month" />

<Button
    android:id="@+id/btnLoadExistingMonth"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_vertical|center"
    android:layout_weight="0.5"
    android:onClick="btnLoadExistingMonth_clickHandler"
    android:text="@string/btn_load_existing_month" />

   </LinearLayout>

The padding should be 6dp for all sides. But at the top , between app title and layout there is a smaller padding?! What’s the solution for that ??

Thanks.

  • 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-14T05:47:09+00:00Added an answer on June 14, 2026 at 5:47 am

    The problem is not with the padding,

    If you look at deep on the layout you can see the difference of the button occupied areas and the layout areas.

    1. Background source for the Button is not fully occupied the spaces in Right,Left,Bottom corners.

    2. But the Background source of the Button has been covered and fully occupied in the top.

    3. Note the Background source of the Button is a 9 patch image with transparent background.

    4. In this case , for example if the Gap which is not occupied by the Background source of the button is 2dp means,

      Right , Left, Bottom there will be a extra 2dp spaces. But not in the Top.

      So with the padding of 6dp you will be get extra background visibility of 2dp for both buttons in the Right,Left,Bottom corners.

    so if your padding value is 6dp , then your layout background visibility will be 8dp in the Right,Left,Bottom corners and 6dp in the top.

    This is the actual problem.

    1. If you change the background color of the button , you can see the even padding values for all 4 corners.

    2. If you are going to create image background for the button then it should be equally created , unlike the android default button background.

    So the solution is , you can create a gradient background for your buttons or you can create a new image file for your buttons.

    Hope you get it and it will be useful tip for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:gravity=center android:background=@drawable/robo> <TextView android:id=@+id/TextView02 android:layout_width=wrap_content android:layout_height=wrap_content android:text=Max Time(Sec)> </TextView>
My Dialog layout contains: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical> The dialog still appears as
i have an root_layout : <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical android:background=@drawable/background android:weightSum=10> <FrameLayout android:id=@+id/parentViewHolder
My XML: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=match_parent android:layout_height=match_parent android:orientation=horizontal android:weightSum=1 > <LinearLayout android:id=@+id/leftLayout android:layout_width=0dp android:layout_height=match_parent
<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:padding=10dp android:orientation=horizontal> <TextView android:id=@+id/groups_massegesTextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=TextView android:layout_marginBottom=20dp android:layout_marginTop=20dp android:layout_marginLeft=10dp
I have this layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent android:background=#222222 android:gravity=center_horizontal android:layout_gravity=center_horizontal android:paddingBottom=5dp> <SeekBar
I have an activity with a background: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent android:minWidth=25px android:minHeight=25px
My code is as shown below: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=match_parent android:layout_height=match_parent android:background=#000000 android:orientation=vertical >
<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <ImageView android:id=@+id/venueImage android:layout_width=wrap_content android:layout_height=wrap_content/> </LinearLayout>
I have this layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=wrap_content android:orientation=horizontal android:gravity=left> <LinearLayout android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal>

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.