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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:43:38+00:00 2026-06-10T16:43:38+00:00

Is there a way to reset a UI object like UITextField to the default

  • 0

Is there a way to reset a UI object like UITextField to the default iOS look and feel?

I ask because I’m putting a red border around a textfield as a part of form validation, and I’m having trouble removing the border so that the UITextField looks exactly as before. I can get it really really close, but it’s off just enough to be noticeable to someone who looks at iPhone screens all day :).

enter image description here enter image description here

This is my code to give the UITextField a red border.

textfield.layer.borderWidth = 2.0f;
textfield.layer.borderColor = [[[UIColor redColor] colorWithAlphaComponent:0.5] CGColor];
textfield.layer.cornerRadius = 8.0f;
  • 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-10T16:43:39+00:00Added an answer on June 10, 2026 at 4:43 pm

    Default values are 0 for borderWidth and cornerRadius and black for borderColor.

    textfield.layer.borderWidth = 0;
    textfield.layer.borderColor = [[UIColor blackColor] CGColor];
    textfield.layer.cornerRadius = 0;
    

    You can also save those values to some field just before changing them and use the saved values when you need to reset the field. This will even work if the default values change in future.

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

Sidebar

Related Questions

Is there a way to reset to the original vb.net snippets that came along
Is there an easy way to reset a django database (i.e. drop all data/tables,
Is there any way to (robustly) reset any possible :after and :before CSS rules
Is there's any way how to reset styles back to what's in my CSS?
Given an IObservable<T> is there a way to use Throttle behaviour (reset a timer
Is there a way to re set a sender tag like NSMutableArray does when
Is there a way to auto generate a Rest service in node.js like in
I have an auto-reset event object created like this: handle = CreateEvent(NULL, true, false,
Is there a way to test if an object is a dictionary? In a
Is there an easy way to generate docs for REST api direct from a

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.