摘要:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{if (range.location > 5){ ... 阅读全文
摘要:
@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment; // how to position content vertically inside control. default is ... 阅读全文
摘要:
UITextField监控输入文字变化方法[self.textFeild addTarget:self action:@selector(textChangeAction:)forControlEvents:UIControlEventEditingChanged];- (void) textCh... 阅读全文
摘要:
在有的时候,我们不需要手势返回功能,那么可以在页面中添加以下代码:- (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; // 禁用 iOS7 返回手势 if ([self.navigationCo... 阅读全文
摘要:
文字高度计算方法CGFloat fixedWidth = self.view.frame.size.width;CGSize newSize = [label sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)];CGFloat height = newSiz... 阅读全文
摘要:
还原UINavigationController 的 UINavigationBar上的系统backBarButtonItem在页面设计过程中,有时候会用到self.navigationItem.leftBarButtonItem = othButtonItem;而实际上在这个位置是存在有一个bac... 阅读全文
摘要:
转换UITableViewCell在 self.navigationController.view 上的位置CGRect rect = [self.navigationController.view convertRect:cell.frame fromView:self.tableView]; ... 阅读全文
摘要:
@interface UIView (RectCorner)@end@implementation UIView (RectCorner)- (void)setCornerOnTop { UIBezierPath *maskPath; maskPath = [UIBezierPath b... 阅读全文
摘要:
获取中文字符串的拼音- (NSString *)phonetic { NSMutableString *source = [self mutableCopy]; CFStringTransform((CFMutableStringRef)source, NULL, kCFStringTr... 阅读全文
摘要:
BOOL bAudioInputAvailable = NO; AVAudioSession *audioSession = [AVAudioSession sharedInstance]; if ([[UIDevice currentDevice].systemVersion flo... 阅读全文