[置顶] iOS不是特别常用的容易忘记的知识点

// cell选中不变色

cell.selectionStyleUITableViewCellSelectionStyleNone;

// 隐藏tableView分割线

self.tableView.separatorStyleUITableViewCellSeparatorStyleNone;

// 隐藏底部tabbar

LoginViewController *loginVC = [[LoginViewController allocinit];

loginVC.hidesBottomBarWhenPushed = YES;

[self.navigationController pushViewController:loginVC animated:YES];

//此处设置的返回按钮文字为"返回",被修改的页面是下一个页面,自己的返回按钮还是"back",没有变成"返回"

UIBarButtonItem *returnButtonItem = [[UIBarButtonItem allocinit];

returnButtonItem.title = @"返回";

self.navigationItem.backBarButtonItem = returnButtonItem;

// 隐藏导航栏

self.navigationController.navigationBarHiddenYES;

// tableView禁止滑动

self.tableView.scrollEnabledNO;

// 设置导航栏颜色

self.navigationController.navigationBar.barTintColormainColor;

// 设置导航栏字体的颜色和大小

[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:k6AutoSize(22)], NSForegroundColorAttributeName:[UIColor whiteColor]}];

// 设置左右两个按钮的颜色

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

// scrollView一页一页的滚动

self.scrollView.pagingEnabledYES;

// 左侧边缘滑动返回

UIScreenEdgePanGestureRecognizer *screenEdgePanGR = [[UIScreenEdgePanGestureRecognizer allocinitWithTarget:self action:@selector(backEvent)];

screenEdgePanGR.edges = UIRectEdgeLeft;

[self.view addGestureRecognizer:screenEdgePanGR];

// 给view添加点击事件

UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer allocinit];

[tapGesture addTarget:self action:@selector(action)];

[view addGestureRecognizer:tapGesture];

// 给右侧navigationItem添加事件

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem allocinitWithTitle:@"提交style:(UIBarButtonItemStyleDonetarget:self action:@selector(submitIdentityInformation)];

// 禁止TextField编辑

self.textField.enabledNO;

// tag值的使用

UILabel *label = (UILabel *)[self.view viewWithTag:1001];

// 判断是否是汉字

for (int i = 0; i < self.identityInformationView.nameTextField.text.length; i++) {

    NSRange range = NSMakeRange(i, 1);

    NSString *subString = [self.identityInformationView.nameTextField.text substringWithRange:range];

    const char *cString = [subString UTF8String];

    if (strlen(cString) != 3) {

    // 是汉字

    }

}

// 复制文字到剪切板

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

pasteboard.string = @"100000";

// 工程目录

$(PRODUCT_NAME)

你可能感兴趣的:(ios开发)