OC滴水穿石

修改類名

選中類里面的類名,選edit-refactor-rename。

獲取系統(tǒng)自帶背景色

self.tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];

pikcerView設(shè)置

//設(shè)置默認(rèn)顯示哪行

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

邊框設(shè)置(圓角、顏色)

UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];

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

[signBtn.layer setMasksToBounds:YES];

[signBtn.layer setCornerRadius:10.0]; //設(shè)置矩形四個圓角半徑

[signBtn.layer setBorderWidth:1.0]; //邊框?qū)挾?/p>

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();

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

[signBtn.layer setBorderColor:colorref];//邊框顏色

輸入框輸入完成鍵盤類型設(shè)置(返回按鈕):

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

//設(shè)置鍵盤返回按鈕設(shè)置(默認(rèn)換行)

detailField.returnKeyType = UIReturnKeyDone;

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

textViewEdit.returnKeyType=UIReturnKeyDone;

圖片填充樣式:

//設(shè)置按鈕內(nèi)圖片樣式居中(原尺寸顯示)

self.imageView.contentMode =UIViewContentModeCenter;

按鈕內(nèi)圖片默認(rèn)拉伸方式填充。

一般選擇UIViewContentModeScaleAspectFill。

刪除一行cell:

[self.list removeObjectAtIndex:row];

[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]

withRowAnimation:UITableViewRowAnimationAutomatic];

移除在dealloc里進(jìn)行。

//去除tableView頂部下拉彈簧效果(禁止tableView反彈)

_myTableView.bounces = NO;

更改手機(jī)狀態(tài)欄樣式

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

淺間隔線:

UIColorFromRGBA(220, 220, 220, 0.8)

獲取一個view內(nèi)部控件最好的辦法!不是遍歷,是設(shè)置tag!

//為cell添加左邊藍(lán)條,只在點(diǎn)擊時顯示

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

blueView.backgroundColor = kMainColorOfApp;

blueView.tag = 111;

[cell addSubview:blueView];

//顯示藍(lán)條

UIView *blueView = [cell viewWithTag:111];

blueView.hidden = NO;

字符串函數(shù)大全:

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

函數(shù)名: floor

功 能: 返回比參數(shù)小的最大整數(shù)

設(shè)置tableview的group樣式:要在alloc時設(shè)置

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

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容