iosuikituitextfieldios26xcode26

UITextField not using rounded corners when app is built with iOS 26


I have an iOS app that uses UIKit. I have many view controllers using UITextField and all of them previously had rounded corners due to the border style: round, which is exactly what I wanted. Now, when I build the app with iOS 26 on Xcode 26.0.1, they all are showing as non-rounded rectangles when I run the app on a device with any iOS version (e.g., 26.0.1, 18.2). The text boxes still show rounded in interface builder. Is this a bug in iOS 26 SDK, or is there something new I need to do?

I created a brand new app just to see if it was an issue, and it is.

Any input would be very helpful. Thanks!

Here are some screenshots demonstrating the issue: Simulator vs Interface Builder

Here are the UITextField settings (default settings): UITextField Settings in Interface Builder


Solution

  • This appears to be a bug in either Xcode 26 or iOS 26 when you set a text field's Border Style to Round in Interface Builder. You end up with the same border as if you had set it to Line.

    There is a work around that requires a tiny bit of code. Follow these steps:

    1. Add an outlet in your view controller and connect the text field to it.

      @IBOutlet var textField: UITextField!
      
    2. In Interface Builder, set the text field's Border Style to None.

    3. Add the following line of code to your view controller's viewDidLoad:

      textField.borderStyle = .roundedRect
      

    This only works if you set the text field's Border Style to None in Interface Builder. If you leave the Border Style set to Round in Interface Builder then the code has no effect changing the border style.

    The other possible solution is to create the text field entirely in code and not add it in Interface Builder.

    P.S. You should file a bug report with Apple using Feedback Assistant.