OC滴水穿石

修改类名

选中类里面的类名,选edit-refactor-rename。

获取系统自带背景色

self.tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];

pikcerView设置

//设置默认显示哪行

[self.pickerGender selectRow:0 inComponent:0 animated:YES];

边框设置(圆角、颜色)

UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];

signBtn.frame = CGRectMake(0, 0, 80, 40);

[signBtn.layer setMasksToBounds:YES];

[signBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径

[signBtn.layer setBorderWidth:1.0]; //边框宽度

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();

CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 1, 0, 0, 1 });

[signBtn.layer setBorderColor:colorref];//边框颜色

输入框输入完成键盘类型设置(返回按钮):

UITextField *detailField = [[UITextField alloc] initWithFrame:CGRectMake(10, 0, screenWith-20, 60)] ;

//设置键盘返回按钮设置(默认换行)

detailField.returnKeyType = UIReturnKeyDone;

UITextView *textViewEdit= [[UITextView alloc] initWithFrame:CGRectMake(10, 0, screenWith-20, 80)];

textViewEdit.returnKeyType=UIReturnKeyDone;

图片填充样式:

//设置按钮内图片样式居中(原尺寸显示)

self.imageView.contentMode =UIViewContentModeCenter;

按钮内图片默认拉伸方式填充。

一般选择UIViewContentModeScaleAspectFill。

删除一行cell:

[self.list removeObjectAtIndex:row];

[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]

withRowAnimation:UITableViewRowAnimationAutomatic];

移除在dealloc里进行。

//去除tableView顶部下拉弹簧效果(禁止tableView反弹)

_myTableView.bounces = NO;

更改手机状态栏样式

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

浅间隔线:

UIColorFromRGBA(220, 220, 220, 0.8)

获取一个view内部控件最好的办法!不是遍历,是设置tag!

//为cell添加左边蓝条,只在点击时显示

UIView *blueView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,4,44)];

blueView.backgroundColor = kMainColorOfApp;

blueView.tag = 111;

[cell addSubview:blueView];

//显示蓝条

UIView *blueView = [cell viewWithTag:111];

blueView.hidden = NO;

字符串函数大全:

http://www.cnblogs.com/heyonggang/p/3452556.html

函数名: floor

功 能: 返回比参数小的最大整数

设置tableview的group样式:要在alloc时设置

CashCouponDetailIntroduceViewController *introduceVC = [[CashCouponDetailIntroduceViewController alloc]initWithStyle:UITableViewStyleGrouped];

self.detailIntroVC = introduceVC;

//如果URL中没有检测到有http,则给它加上

NSRange range = [self.url rangeOfString:@"Http" options:NSCaseInsensitiveSearch];

if (range.location == NSNotFound) {

self.url = [@"http://" stringByAppendingString:self.url];

}

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

推荐阅读更多精彩内容

  • 1.自定义控件 a.继承某个控件 b.重写initWithFrame方法可以设置一些它的属性 c.在layouts...
    圍繞的城阅读 3,444评论 2 4
  • 概述在iOS开发中UITableView可以说是使用最广泛的控件,我们平时使用的软件中到处都可以看到它的影子,类似...
    liudhkk阅读 9,085评论 3 38
  • 1.badgeVaule气泡提示 2.git终端命令方法> pwd查看全部 >cd>ls >之后桌面找到文件夹内容...
    i得深刻方得S阅读 4,723评论 1 9
  • iOS开发系列--网络开发 概览 大部分应用程序都或多或少会牵扯到网络开发,例如说新浪微博、微信等,这些应用本身可...
    lichengjin阅读 3,705评论 2 7
  • 曾经问过盆友,如果有一种能力可以预见未来你觉得怎样?她答到,如果未来都可以预见那多没意思,因为什么都知道了。我心里...
    西珍菇凉阅读 377评论 2 1