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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:49:41+00:00 2026-06-18T08:49:41+00:00

I created a custom button: <?xml version=1.0 encoding=utf-8?> <selector xmlns:android=http://schemas.android.com/apk/res/android> <item android:state_pressed=true> <shape> <gradient

  • 0

I created a custom button:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <shape>
            <gradient android:startColor="#5a803f"
                android:endColor="#446c1a" android:angle="90" />
            <stroke android:width="5dp" android:color="#3d5e1d" />
            <corners android:radius="3dp" />
            <padding android:left="8dp" android:top="8dp"
                android:right="8dp" android:bottom="8dp" />
        </shape>
    </item>
    <item android:state_focused="true">
        <shape>
            <gradient android:startColor="#5a803f"
                android:endColor="#446c1a" android:angle="90" />
            <stroke android:width="5dp" android:color="#3d5e1d" />
            <corners android:radius="3dp" />
            <padding android:left="8dp" android:top="8dp"
                android:right="8dp" android:bottom="8dp" />
        </shape>
    </item>
    <item>

    </item>

</selector>

But I need to place this button to the black background with defined margins and with white borders at the top and bottom. And this background shouldn’t be clickable. Something like this:

enter image description here

How can I implement this? with the help of this selector or style using. Help please with a code sample.

  • 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-18T08:49:42+00:00Added an answer on June 18, 2026 at 8:49 am

    I solved this issue using the TableLayout. In this case my TextView is looks like:

       <TableRow
        android:id="@+id/tableRow3"
        style="@style/button_row"
        >
        <Button
    
            android:id="@+id/btnProceed"
            style="@style/custom_button"
            android:layout_centerHorizontal="true"
            android:text="Log In"
             />
        </TableRow>
    

    etc for all UI elements.

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

Sidebar

Related Questions

I've created a custom buttom with a selector: <?xml version=1.0 encoding=utf-8?> <selector xmlns:android=http://schemas.android.com/apk/res/android> <item
I have a custom button style as follows: <?xml version=1.0 encoding=utf-8?> <selector xmlns:android=http://schemas.android.com/apk/res/android >
I have a custom RelativeLayout in remote_image_view.xml : <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=wrap_content
I created a custom button skin: <?xml version=1.0 encoding=utf-8?> <s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx minWidth=65
I have created a custom listView with the row as follows: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have created a custom Button as follows. file : buttoncontrol.xml <?xml version=1.0 encoding=utf-8?>
I have created a custom dialog and a layout xml: <?xml version=1.0 encoding=utf-8?> <LinearLayout
I created a custom button component that accepts an array as a property. I
So here's is the situation: I've created a custom button that minimizes my WPF
I created a custom UITableViewCell subclass which contains a button named testbtn . I

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.