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 9266511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:20:10+00:00 2026-06-18T14:20:10+00:00

I have two buttons with xml background , i want to keep some space

  • 0

I have two buttons with xml background , i want to keep some space between them, because that are past exactly on each other , also i want to put white line above them , i will give you how i tried but it doesn’t work with me

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="25dip"

    android:orientation="horizontal"

    android:weightSum="2" >

    <Button
        android:background="@drawable/button_selector"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:textColor="#FFFFFF"
        android:gravity="center"
        android:textStyle="bold"
        android:text="@string/b_save" />

    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:textColor="#FFFFFF"
        android:gravity="center"
        android:background="@drawable/button_selector"
        android:text="@string/b_cancel" />
</LinearLayout>

xml background

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

    <padding android:top="10dip"
        android:bottom="10dip"/>



    <!-- Gradient Bg for listrow -->
    <gradient
        android:useLevel="false"
        android:angle="270"
        android:centerColor="#000000"
        android:endColor="#FFFFFF"
        android:startColor="#808080" />
</shape>

enter image description here

  • 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-18T14:20:12+00:00Added an answer on June 18, 2026 at 2:20 pm

    check this out

    enter image description here

    bg_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
    
        <padding android:top="10dip"
            android:bottom="10dip"/>
    
    
    
        <!-- Gradient Bg for listrow -->
        <gradient
            android:useLevel="false"
            android:angle="270"
            android:centerColor="#808080"
            android:endColor="#000000"
            android:startColor="#FFFFFF" />
    </shape>
    

    button_bg.xml

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
    
        <padding android:top="10dip"
            android:bottom="10dip"/>
    
    
    
        <!-- Gradient Bg for listrow -->
        <gradient
            android:useLevel="false"
            android:angle="270"
            android:centerColor="#000000"
            android:endColor="#808080"
            android:startColor="#FFFFFF" />
    </shape>
    

    your xml

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="25dip"
        android:orientation="horizontal"
        android:background="@drawable/bg_selector"
        android:weightSum="2" >
    
        <Button
            android:background="@drawable/bg_selector"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#FFFFFF"
            android:gravity="center"
            android:textStyle="bold"
            android:layout_marginRight="4dip"
            android:layout_marginLeft="10dip"
            android:text="@string/b_save" />
    
        <Button
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#FFFFFF"
            android:gravity="center"
            android:layout_marginLeft="4dip"
            android:layout_marginRight="10dip"
            android:background="@drawable/bg_selector"
            android:text="@string/b_cancel" 
            android:textStyle="bold"/>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set the two buttons in preference.xml file. I want to go to
I have a header for a list that contains two image buttons. I want
I have two buttons in a frame layout and want them to align at
I have two buttons in my xml layout as shown bellow. I used an
In main.xml I would like to have a spinner1 with two radio buttons and
I have two buttons that moves a movieclip up/down the Y-axis. How do I
Im programming a little game where two Players have to click some Buttons it
I have a screen with a background image and two buttons at the bottom.
I have two layouts that call footer.xml, first one is login.xml, and second is
Some Background I have a TableLayout with 9 rows. I chose the TableLayout because

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.