摘要:在iOS 8中,苹果引入了UITableView的一项新功能--Self Sizing Cells,对于不少开发者来说这是新SDK中一项非常有用的新功能。在iOS 8之前,如果想在表视图中展示可变高度的动态内容时,你需要手动计算行高,而Self Sizing Cells为展示动态内容提供了一个解决方...
阅读全文
摘要://设置textField的placeholder字体的颜色,默认是灰色UIColor *color = [UIColor whiteColor];self.loginNumText.attributedPlaceholder = [[NSAttributedString alloc] initWi...
阅读全文
摘要://设置按钮颜色 self.autoLoginCheckBox.layer.borderColor = [[UIColor redColor] CGColor]; //设置边框宽度 self.autoLoginCheckBox.layer.borderWidth = 1; //设置按钮为圆...
阅读全文
摘要:很多时候我们想限制textView中的输入字数,我们可以利用函数- (void)textViewDidChange:(UITextView *)textView中统计textView实现此功能。通过在此函数中统计你输入的字符的个数,当字数超过你限制的字数时调用函数-(NSString *)subst...
阅读全文
摘要:要限制一个UITextField的输入字数(参考链接),首先想到的应该是通过UITextFieldDelegate的代理方法来限制:- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)ra...
阅读全文
摘要:self.table.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.table.bounds.size.width, 0.01f)];
阅读全文
摘要://把UIImageView控件的contentMode属性设成下面这样就可以等比例缩放了imageView1.contentMode = UIViewContentModeScaleAspectFit;
阅读全文