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 W3Make Forum 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 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.

Sign InSign Up

Forum By W3make

Forum By W3make Logo Forum By W3make Logo

Forum By W3make Navigation

  • Home
  • About Us
  • Blog
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Questions Feed
  • Blog
  • Contact Us
Home/ Questions/Q 8453
Next
Aditya017
  • 0
Aditya017Begginer
Asked: June 21, 20232023-06-21T14:37:44+05:30 2023-06-21T14:37:44+05:30In: Android Development

Text field border

  • 0

How to give border to a text field and other decoration to the borders like round edges.

android development
  • 0 0 Answers
  • 458 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

0 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. yash parab Begginer
    2023-06-21T18:18:25+05:30Added an answer on June 21, 2023 at 6:18 pm

    1.) Create a drawable XML file in your project’s “res/drawable” directory, and create a new XML file to define the border’s appearance.
    2.) Open the XML file and define the shape of the drawable. For a rounded border, you can use the “” tag and set the shape like a rectangle
    3.) You can also specify the desired border width, colour, and corner radius using attributes such as “android:strokeWidth”, android:strokeColor, and android:corners
    4.) Then apply the changes activity_main.xml file, in the Edittext add the “android:background” attribute and set it to the reference of the drawable XML file you have made.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. ashishrp Begginer
    2023-06-21T19:31:56+05:30Added an answer on June 21, 2023 at 7:31 pm

    Start Android Studio and open your project.

    Add the following code to your layout XML file, activity_main.xml, to create the TextField:

    <EditText

    android:id=“@+id/editText”

    android:layout_width=“match_parent”

    android:layout_height=“wrap_content” android:background=“@drawable/text_field_border”

    android:padding=“8dp” android:hint=“Enter text”/>

     

    For the border drawable, make a new XML file. Drawable resource file by selecting “New” from the context menu of the res directory. Click OK after giving the file a name, such as text_field_border.xml.

    Add the following code to the text_field_border.xml file by opening it:

    <shape xmlns:android=”http://schemas.android.com/apk/res/android”>
    <solid android:color=”#FFFFFF”/> 
    <stroke android:color=”#000000″ android:width=”2dp”/> 
    <corners android:radius=”8dp”/> <!– Rounded corner radius –>
    </shape>

     

    Make the attributes your own according to your preferences. The background colour, border colour, width, and corner radius can all be modified.

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

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 3k
  • Answers 2k
  • Best Answers 34
  • Users 5k
  • Popular
  • Answers
  • Mohammed aleem hasan

    What programming language is used for Android development?

    • 65 Answers
  • Manichandana

    Is this mandatory to write css code in making a ...

    • 58 Answers
  • vishakha_1713

    How to decide whether to use DELETE statement or DROP ...

    • 46 Answers
  • Matted
    Matted added an answer Media portrayals have played a significant role in shaping attitudes.… December 17, 2025 at 6:12 pm
  • Katharine369
    Katharine369 added an answer The more realistic the top rated sex doll appears, the… November 25, 2025 at 1:53 pm
  • james223
    james223 added an answer My life is measured in kilometers and rupees. The smell… November 21, 2025 at 6:20 pm

Related Questions

  • dumpstop9

    Https://Vaild.Work/ sell Dumps track 1&2 Real CC Cloned Cards ATM ...

    • 0 Answers
  • dumpstop9

    https://vaild.work/ Selling PayPal&Cashapp Buy CCV Data Track 1/2 Cloned Card ...

    • 0 Answers
  • dumpstop9

    Vaild.Work =  Real Dumps Shop Track 1&2 Valid 90%+ This ...

    • 0 Answers

Top Members

saningh

saningh

  • 5 Questions
  • 116 Points
Pundit
Vishnu M

Vishnu M

  • 2 Questions
  • 96 Points
Teacher
Jimekalmiya

Jimekalmiya

  • 57 Questions
  • 77 Points
Teacher

Trending Tags

#css #html #questions 3d printing ai android android development android studio answer api app development c++ coding data Database developer development error flutter hacking help ios java javascript kotlin machine learning ml performance php plugin plugins poll programming python question security seo social media sql technology theme web web development website WordPress word press wordpress development wordpressdevelopment wordpress error wordpress errors

Explore

  • Recent Questions
  • Most Answered
  • Answers
  • Most Visited
  • Most Voted
  • No Answers
  • Feed
  • Favorites Questions

Footer

W3make forum is a social questions & Answers platform which will help you establis your community and connect with other people.

Legal Stuff

  • Privacy Policy
  • Terms and Conditions

Help

  • Questions Feed
  • Blog
  • Contact Us

Follow

© 2023 W3make.com | All Rights Reserved.

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.