1 关于TextFiled 输入类容改变代理
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
//text 最准确的字符串
NSString *text = [textField.text stringByReplacingCharactersInRange:range withString:string];
NSLog(@"---text:%@",text);//输入改变后最及时的text(眼睛能够看到的)
NSLog(@"---textField:%@",textField.text); //入股改变前的文本
NSLog(@"---string:%@",string); //当前操作的单个字符
return YES;
}
过渡动画
//添加展示动画
CATransition *anima = [CATransition animation];
anima.type = kCATransitionMoveIn;//设置动画的类型
anima.subtype = kCATransitionFromRight; //设置动画的方向
anima.duration = 0.5f;
[_searchV.layer addAnimation:anima forKey:@"moveInAnimation"];
手势冲突
#pragma mark tapGestureRecgnizerdelegate 解决手势冲突
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
if ([touch.view isKindOfClass:[UITableView class]]){
return NO;
}
if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {
return NO;
}
return YES;
}
改变状态栏颜色
先将View controller-based status bar appearance设为YES,然后在该控制器内添加
//NavControllerView 重写
- (UIViewController *)childViewControllerForStatusBarStyle {
return self.topViewController;
}
//单个子页面改变
-(UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}