I am using a search bar (UISearchBar
) in my app and I want to override the editingRectForBounds
and textRectForBounds
method.
How would I be able to do this? Please help.
I am using a search bar (UISearchBar
) in my app and I want to override the editingRectForBounds
and textRectForBounds
method.
How would I be able to do this? Please help.
If your intention is to restrict size of text field, this could be useful 1.Create a subclass of UISearchBar
2.Include this code in the drawRect: method.
UITextView * textField = [self.subviews objectAtIndex:0]; textField.frame = CGRectMake(5, 6, (310 - kRightSideMargin), 31);
[super drawRect:rect]; changing-the-size-of-the-uisearchbar-textfield
Create a subclass of UITextField
eg. @interface DemoTextField : UITextField
and simply override your methods in implementation (.m) file