How to remove "border-radius" from default UITextField? - ios

My question is, how do I remove the "border-radius" of the textfield in Swift? Is it achievable in xCode or do you need to do a customized textfield? If so, how do I do that? I want the default textfield but without it's "border-radius" if you know what I mean.
Help, please!

UITextField has an attribute borderStyle, which can be changed either in interface builder:
...or in code:
public var borderStyle: UITextBorderStyle // default is UITextBorderStyleNone. If set to UITextBorderStyleRoundedRect, custom background images are ignored.

You can set the border style using Storyboards.
And also you can set border style programitically
[txtUserName setBorderStyle:UITextBorderStyleNone];

What do you exactly mean with border-radius? the border around it?
You can turn that off by clicking the button in xcode:
Or if you want to do it programmatically do:
myButton.bordered = false

Related

How to move placeholder up while typing in the textfield? is it possible just from storyboard? or code in IOS Objective-C?

I have set the values of placeholder
self.baseURLTextField.placeholder = ServiceUrl_English;
self.paymentBaseURLTextField.placeholder = PAYMENTSERVICEURL_ENGLISH;
I just want to move the placeholder up while editing or typing in textfield. is it possible through just only storyboard? or code in Objective-C.
Not really the way you intended it. Placeholder is just a hint of what should be typed in the textField and it's supposed to be removed once text entry starts.
If you want the placeholder to "move up" I suggest you either prefill the textField with the text you want to preserve, or simply add the text at the point user starts typing in, and move the cursor to where you want the user text to start.
You can achieve this by putting a UILabel at the top of the text view then show/hide it whenever the user starts typing.
Or you can use a pod like JVFloatLabeledTextField

How to disable isEnable and isUserInteraction attributes but keep cursor show in UITextField?

I have a custom framework for UITextField. For now, I want to disable two attribute as the question above but still keep the cursor show in my custom textfield. I already disable the keyboard with set the inputView = UIView(), and that successful for hide the keyboard even show the cursor inside textField.
My goal is disable both attributes like above or another for can not Select All action from my textField, but still keep the cursor available anytime.
Hope to hear the ideas from you guys. Thank a lot!

How to change placeholder text color in xib?

How to change placeholder text color in xib ? I have tried key path thing but it is giving me NSException. Can anyone please help.
The easiest method to modify the placeholder text color is through the Xcode storyboard interface builder. Select the UITextField of interest and open the identity inspector on the right. Click on the plus symbol in the User Defined Runtime Attributes and add a new row with Key Path as placeholderLabel.textColor, Type as Color and Value to your desired color.
Navneils answer with screenshot ,You can set opacity also from here
use placeholderLabel.textColor instead of _placeholderLabel.textColor for swift 5.0 and iOS 13
We cannot change textcolor of placeholder text in storyboard. Manually we can change with the property name.
Addthis code in viewDidLoad
[nameTextField setValue:[UIColor colorWithRed:41.0/255.0 green:91.0/255.0 blue:106.0/255.0 alpha:1.0] forKeyPath:#"_placeholderLabel.textColor"];

GridPanel cell editing of type 'textfield'

I'm using a GridPanel with the 'CellEditing' plugin.
My editor cell is of type 'textfield'.
I have 2 questions:
I would like to change the background color of empty cells so that it would be easier to see where there are missing values.
When double clicking a cell, I would like to format the text of the textfield. How do I get to the textfield object?
Thank you,
Dana
You might give the textfield an id property.
field: {
id: 'myId',
...
}
Access the field with
var objTextfield = Ext.getCmp('myId');
About the color, you must add or overwrite the CSS. You can set a config property 'cls' to a custom css class. See here: http://docs.sencha.com/ext-js/4-0/#/api/Ext.form.field.Text-cfg-cls

How can I get my text appended to the placeholder programmatically

I want to add a variable place holder in my textField and when something is written in textField, that text should be appended to place holder without any change to place holder. How should I go about it?
you can do this by using clearsOnBeginEditing property and set it to FALSE.
textField.clearsOnBeginEditing = NO;
If you are creating textfield by interface builder then you have to go to inspector in Interface Builder(Press command 1) and finally you have to uncheck the Clear when editing begins option.

Resources