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

App開發中技術點分享!
qcw100
2016-08-17 09:37:44
65

1. >> 設置cell高度自適應:

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

[cell setupAutoHeightWithBottomView:_view4 bottomMargin:10];


2. >> 設置 tableview 數據源和代理

- (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 根據模型取得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文字自適應:

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

_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個參數:(UIView)參照view 和 (CGFloat)間距數值

4.2 > widthRatioToView(self.view, 1)

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

4.3 > topEqualToView(view)

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

4.4 > widthIs(100)

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

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

文章出自:北京網站建設公司-前潮網絡 http://www.lirzik.com 如需轉載請注明,010-57227103.

相關推薦
您想要定制網站嗎?
如果您想要走進互聯網,并且想找一個出色的團隊,那就趕緊聯系我們吧~