![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
oc学习笔记
qq_29254653
这个作者很懒,什么都没留下…
展开
-
oc 查找字符串的常见方法
查找字符串的常见方法使用NSString方法中的 -(NSRange)rangeOfString:(NSString *)searchString;NSString * str = @"https://blog.csdn.net";NSRange range = [str rangeOfString:@"http"]; NSLog(@"%@", NSStringFromRange(range)); if(range.length == 0){ NSLog(@"str中没找到目标原创 2022-01-20 16:04:36 · 2379 阅读 · 0 评论 -
UIButton 里面设置圆角方法
UIButton 里面设置圆角方法代码设置 self.button.layer.cornerRadius = 5; self.button.layer.masksToBounds = YES;xib设置原创 2022-01-07 12:08:04 · 1852 阅读 · 0 评论 -
OC获取UITextField的成员变量的方法
OC获取UITextField的成员变量的方法#import <objc/runtime.h> unsigned int count; Ivar *ivarList = class_copyIvarList([UITextField class], &count); for (int i=0; i< count; i++) { Ivar ivar = ivarList[i]; NSLog(@"%s",ivar_getName(ivar)原创 2022-01-07 12:02:36 · 1096 阅读 · 0 评论 -
修改UITextField占位文字的颜色
使用attributedPlaceholder@property(nonatomic, copy) NSAttributedString *attributedPlaceholder; // 具体做法 NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; attributes[NSForegroundColorAttributeName] = [UIColor whiteColor]; //.原创 2022-01-07 11:38:55 · 745 阅读 · 0 评论