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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:29:32+00:00 2026-05-31T22:29:32+00:00

My question is : I have an EditText and I want set a margin

  • 0

My question is : I have an EditText and I want set a margin inside the EditText, I mean margin for the content (the text) of the edit text, not a margin for a the view witch I can resolve by this attribute : android:layout_marginLeft.

I need let some space before and after the text inside the EditText.

I tried to set the padding, but doesn’t work !

this is my xml code :

<FrameLayout
    android:layout_width="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content" 
    android:layout_marginLeft="2dp">

    <EditText android:inputType="none"
        android:textSize="15sp" 
        android:id="@+id/editText1" 
        android:scrollHorizontally="true" 
        android:layout_height="35dp"  
        android:padding="3dip" 
        android:singleLine="true"
        android:layout_width="160dp" 
        android:layout_weight="0" />

    <ImageView android:id="@+id/refreshButton" 
        android:src="@drawable/refresh" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content"
        android:layout_gravity="center_vertical|right" />
</FrameLayout>

Can any one help me to do that?

Thanks in advance

  • 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-05-31T22:29:33+00:00Added an answer on May 31, 2026 at 10:29 pm

    The padding variable should be exactly what you are looking for. You should try to increase the padding to something like 10dp just to test if it does anything. I’m guessing that because the background of the EditText is a 9 patch the padding is not acting how you would expect. When you set padding on a view with a 9 patch as the background any padding that is built into the 9 patch is than ignored. So if the 9 patch has 5dp padding and you set 3dp padding in the xml you will not get 8dp padding you will get 3dp.

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

Sidebar

Related Questions

I have a question about EditText in Android. How can I set the hint
My question is how can i clear the editText field after i have saved
I have EditText view in android .. i want when the enters a letter
I have a preliminary question I want users to answer before a certain EditText
I have one question: How can I select what soft-keyboard an edittext will load?
I want to show pop up of question with it's options. Each question have
Question: I have a question that is apparently not answered by this already-asked Bash
Question We have a large number of xml configuration files that we want merged
I have question about NSView: Imagine a Custom View where the mouseDown, mouseDrag and
I have question regarding the SQLAlchemy. How can I add into my mapped class

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.