-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i put icons on the textfield like this #495
Comments
Few techniques you can use for this:
@DanielDahan Might be nice to consider this for option in Material 2. Thanks @Cosmo1234 - closing this ticket. |
@adamdahan agreed. |
any news about that? Using leftView, the layout looks like was made by an amateur designer. |
@CavalcanteLeo can you try this commit: 5065e88, it is available in Objc-C now. As well, have you looked at the TextField sample? To put it fully across as the image above, I will need to investigate that. |
I could do it by creating a UITextField Category in objective-c #import <objc/runtime.h>
@implementation UITextField (Padding)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectMake(bounds.origin.x + 21, bounds.origin.y + 8,
bounds.size.width - 31, bounds.size.height - 16);
}
- (CGRect)editingRectForBounds:(CGRect)bounds {
return [self textRectForBounds:bounds];
}
@end
and then i just imported to my viewcontroller, But i will try this commit, this might work, and will be much better than create a category to change the properties |
@CavalcanteLeo Yes, I reopened the issue to make an internal fix for this :) Maybe you can suggest something before I jump into this issue more. |
Amazing! |
The text was updated successfully, but these errors were encountered: