oc控件
ZHUTAN_123
这个作者很懒,什么都没留下…
展开
-
允许部分页面横竖屏
1 首先需要Xcode中选中支持的屏幕方向 2 Appdelegate中 .h@property (nonatomic,assign)NSInteger allowRotate; .m中//此方法会在设备横竖屏变化的时候调用- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientation原创 2017-09-30 09:34:14 · 377 阅读 · 0 评论 -
tableView的点击事件或textfield 与手势冲突解决
1,遵循手势代理 2,关联代理 3,实现手势的代理方法- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ if ([touch.view isKindOfClass:[UITextField class]]) {原创 2017-06-15 10:41:52 · 1817 阅读 · 0 评论 -
webview 去掉滚动条和上下黑灰色背景
// 去掉webView的滚动条 for (UIView *subView in [webView subviews]) { if ([subView isKindOfClass:[UIScrollView class]]) { // 不显示竖直的滚动条 [(UIScrollView *)subView原创 2017-06-23 10:33:58 · 873 阅读 · 1 评论 -
打印控件坐标
NSLog(@"%@",NSStringFromCGRect(webV.frame));原创 2017-06-24 10:04:33 · 408 阅读 · 0 评论 -
label上文字数字混排,只改变数字颜色
NSString *dateContent=[[NSString alloc] initWithFormat:@"剩%i天%i小时",days,hours]; NSLog(@"%@",dateContent); NSArray *number = @[@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9"]; NSMutableAt原创 2017-06-27 11:56:17 · 402 阅读 · 0 评论 -
UIScrollView滑动与轻扫手势冲突
遵循UIGestureRecognizerDelegate协议 UIView *view = [[UIView alloc]initWithFrame:CGRectMake(sWidth * (_imagesArr.count - 1), 1, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.hei原创 2017-07-04 11:42:58 · 769 阅读 · 0 评论 -
launchImage 启动页的设置
LaunchScreen.storyboard 的运用 点击LaunchScreen.storyboard,用IB为LaunchScreen添加一个UIImageView,将UIImageView的image 设置成你想要的图片,为UIImageView 添加约束。如图 设置LaunchScreen.storyboard为 LaunchScreen.运行一下看到效果 2. 使用Laun转载 2017-07-16 09:08:25 · 1571 阅读 · 0 评论 -
禁止导航条右滑返回上一页
1,遵循协议 UIGestureRecognizerDelegate,UINavigationBarDelegate 2, id target = self.navigationController.interactivePopGestureRecognizer.delegate; UIPanGestureRecognizer *pan = [[UIPanGestureRecognize原创 2017-09-06 10:13:24 · 509 阅读 · 0 评论 -
视频全屏的时候显示状态栏
视频全屏的时候也显示状态栏[UIApplication sharedApplication].statusBarHidden = NO; [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];原创 2017-09-22 13:21:20 · 1039 阅读 · 0 评论 -
同一label,不同字体颜色
UILabel* noteLabel = [[UILabel alloc] init]; noteLabel.frame = CGRectMake(0, 100, 200, 100); noteLabel.backgroundColor = [UIColor yellowColor]; noteLabel.textColor = [UIColor blackColor];原创 2017-10-31 15:43:32 · 511 阅读 · 0 评论