少妇做爰免费视频网站色黄-freehdxxxx4kvideos-九九精品在线观看视频-国产农村1级毛片|www.lirzik.com

App開發(fā)中技術(shù)點分享!
qcw100
2016-08-17 09:37:44
65

1. >> 設(shè)置cell高度自適應(yīng):

// cell布局設(shè)置好之后調(diào)用此方法就可以實現(xiàn)高度自適應(yīng)(注意:如果用高度自適應(yīng)則不要再以cell的底邊為參照去布局其子view)

[cell setupAutoHeightWithBottomView:_view4 bottomMargin:10];


2. >> 設(shè)置 tableview 數(shù)據(jù)源和代理

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

// 2.1 注冊模型cell

[self.tableView startAutoCellHeightWithCellClass:“cell類名” contentViewWidth:“contentview寬度”];

return _rowCount;

}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{

// 2.2 根據(jù)模型取得cell高度

return [self.tableView cellHeightForIndexPath:indexPath model:“model” keyPath:@"model屬性名"];


3.>>用法示例

/* 用法一 */

_view.sd_layout

.leftSpaceToView(self.view, 10)

.topSpaceToView(self.view, 80)

.heightIs(130)

.widthRatioToView(self.view, 0.4);

/* 用法二 (一行代碼搞定,其實用法一也是一行代碼) */

_view.sd_layout.leftSpaceToView(self.view, 10).topSpaceToView(self.view,80).heightIs(130).widthRatioToView(self.view, 0.4);

>> UILabel文字自適應(yīng):

// autoHeightRatio() 傳0則根據(jù)文字自動計算高度(傳大于0的值則根據(jù)此數(shù)值設(shè)置高度和寬度的比值)

_label.sd_layout.autoHeightRatio(0);


注意:先把需要自動布局的view加入父view然后在進行自動布局

UIView *view0 = [UIView new];

UIView *view1 = [UIView new];

[self.view addSubview:view0];

[self.view addSubview:view1];

view0.sd_layout

.leftSpaceToView(self.view, 10)

.topSpaceToView(self.view, 80)

.heightIs(100)

.widthRatioToView(self.view, 0.4);

view1.sd_layout

.leftSpaceToView(view0, 10)

.topEqualToView(view0)

.heightRatioToView(view0, 1)

.rightSpaceToView(self.view, 10);


4.>>用法簡析


4.1 > leftSpaceToView(self.view, 10)

方法名中帶有“SpaceToView”的方法表示到某個參照view的間距,需要傳遞2個參數(shù):(UIView)參照view 和 (CGFloat)間距數(shù)值

4.2 > widthRatioToView(self.view, 1)

方法名中帶有“RatioToView”的方法表示view的寬度或者高度等屬性相對于參照view的對應(yīng)屬性值的比例,需要傳遞2個參數(shù):(UIView)參照view 和 (CGFloat)倍數(shù)

4.3 > topEqualToView(view)

方法名中帶有“EqualToView”的方法表示view的某一屬性等于參照view的對應(yīng)的屬性值,需要傳遞1個參數(shù):(UIView)參照view

4.4 > widthIs(100)

方法名中帶有“Is”的方法表示view的某一屬性值等于參數(shù)數(shù)值,需要傳遞1個參數(shù):(CGFloat)數(shù)值a 

app開發(fā)時下很火,但是不是每一個有錢的企業(yè)都需要做app或者能做app,八年的網(wǎng)站建設(shè)公司,我們更多的是從客戶角度出發(fā),建立長期的合作關(guān)系。

文章出自:北京網(wǎng)站建設(shè)公司-前潮網(wǎng)絡(luò) http://www.lirzik.com 如需轉(zhuǎn)載請注明,010-57227103.

相關(guān)推薦
您想要定制網(wǎng)站嗎?
如果您想要走進互聯(lián)網(wǎng),并且想找一個出色的團隊,那就趕緊聯(lián)系我們吧~