免费网站观看www在线观,免费网站在线观看人数在哪里直播,中文资源在线官网,成人做爰A片免费看网站下载爱奴,裸体做a爰片毛片a片免费

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

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

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

[cell setupAutoHeightWithBottomView:_view4 bottomMargin:10];


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

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

{

// 2.1 注冊模型(xing)cell

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

return _rowCount;

}

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

{

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

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


3.>>用法示(shi)例

/* 用(yong)法一(yi) */

_view.sd_layout

.leftSpaceToView(self.view, 10)

.topSpaceToView(self.view, 80)

.heightIs(130)

.widthRatioToView(self.view, 0.4);

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

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

>> UILabel文字(zi)自適應(ying):

// autoHeightRatio() 傳(chuan)0則根據文字自動計(ji)算高(gao)度(du)(du)(傳(chuan)大于0的(de)值(zhi)則根據此數(shu)值(zhi)設(she)置高(gao)度(du)(du)和寬度(du)(du)的(de)比值(zhi))

_label.sd_layout.autoHeightRatio(0);


注意(yi):先把需要自動布(bu)(bu)局(ju)的(de)view加入(ru)父view然后在進行(xing)自動布(bu)(bu)局(ju)

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.>>用法(fa)簡(jian)析


4.1 > leftSpaceToView(self.view, 10)

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

4.2 > widthRatioToView(self.view, 1)

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

4.3 > topEqualToView(view)

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

4.4 > widthIs(100)

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

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

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

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