UIView
//移除view中所有的字视图
[self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//设置阴影(颜色,偏移坐标,透明度)
view.layer.shadowColor=[UIColor grayColor].CGColor;
view.layer.shadowOffset=CGSizeMake(-1, -2);
view.layer.shadowOpacity=0.2;
UIImageView
//等比拉伸
imgView.contentMode =UIViewContentModeScaleAspectFill;
//裁掉多余部分
imgView.clipsToBounds = YES;
UITextField
//缩回键盘
[[[UIApplication sharedApplication]keyWindow]endEditing:YES];
//为某个控件调起(缩回)键盘
[self.textField becomeFirstResponder];
[self.textField resignFirstResponder];
//textfield输入时显示系统默认键盘,加载自定义键盘是替换nil即可
self.textField.inputView=nil;
[self.textField reloadInputViews];
//删除最后一位字符
[self.textField deleteBackward];
//设置文本的左边距
UIView *view = [UIView new];
view.frame = CGRectMake(0 ,0 ,width ,0);
textField.leftView = view
textField.leftViewMode = .always
//修改textfield的提示字符颜色
-(NSAttributedString *)chageTextfieldPlacColor:(NSString *)plachorStr andPlacTextColor:(UIColor *)color{
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:plachorStr attributes:@{NSForegroundColorAttributeName:color}];
return attrString;
}