1.修改textfield的顏色及位置
可以繼承textfield類
重寫它的方法;
-(void)drawPlaceholderInRect:(CGRect)rect
{
[[UIColor purpleColor]setFill];
[self.placeholder drawInRect:rect withFont:self.font lineBreakMode:UILineBreakModeTailTruncation alignment:self.textAlignment];
}
2.設(shè)置導(dǎo)航條透明?
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
3.當(dāng)自定義導(dǎo)航條左側(cè)的item ?iOS 自帶的側(cè)滑就會(huì)消失 可以這樣來實(shí)現(xiàn)側(cè)滑
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:nil style:UIBarButtonItemStylePlain target:self action:@selector(act)];? ? self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
4.監(jiān)控鍵盤的事件蔬啡;IQKeyboardManager ?三方庫
滑動(dòng)奈揍,點(diǎn)擊 隱藏導(dǎo)航欄(iOS8之后)
self.navigationController.hidesBarsOnSwipe = YES;
self.navigationController.hidesBarsOnTap = YES;
5.xib中設(shè)置邊框
@interface CALayer (XibConfiguration)
// layer.cornerRadius
// layer.borderWidth
// layer.borderUIColor? 邊框顏色屬性用borderUIColor
@property(nonatomic, assign) UIColor *borderUIColor;
-(void)setBorderUIColor:(UIColor*)color
{self.borderColor = color.CGColor;}
-(UIColor*)borderUIColor
{return [UIColor colorWithCGColor:self.borderColor];}