sunshine随笔

1.修改textfield的颜色及位置

可以继承textfield类

重写它的方法;

-(void)drawPlaceholderInRect:(CGRect)rect

{

[[UIColor purpleColor]setFill];

[self.placeholder drawInRect:rect withFont:self.font lineBreakMode:UILineBreakModeTailTruncation alignment:self.textAlignment];

}

2.设置导航条透明 

[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];

self.navigationController.navigationBar.shadowImage = [UIImage new];

self.navigationController.navigationBar.translucent = YES;

3.当自定义导航条左侧的item  iOS 自带的侧滑就会消失 可以这样来实现侧滑

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:nil style:UIBarButtonItemStylePlain target:self action:@selector(act)];    self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;

4.监控键盘的事件;IQKeyboardManager  三方库

滑动,点击 隐藏导航栏(iOS8之后)

self.navigationController.hidesBarsOnSwipe = YES;

self.navigationController.hidesBarsOnTap = YES;

5.xib中设置边框

@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];}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容