欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

iOS中tableView的分類有哪些-創(chuàng)新互聯(lián)

這篇文章主要介紹iOS中tableView的分類有哪些,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

目前成都創(chuàng)新互聯(lián)已為1000+的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站托管運(yùn)營、企業(yè)網(wǎng)站設(shè)計(jì)、尉犁網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

大致分了一下,一個(gè)uitableview需要幾個(gè)方法去實(shí)現(xiàn), 創(chuàng)建一個(gè)tableivew,自定義一個(gè)cell,一個(gè)cell的模型,一個(gè)cell子控件的大小,復(fù)雜的話可以在加一個(gè)繼承tableview的方法1般是3種或者4種,或者是5種。

#import "ViewController.h"

@interface XXTableiewCell : UITableViewCell

@end

const float XXTableiewCell_fontSize = 12;

@interface XXTableiewCell ()

@property (strong, nonatomic) UILabel * titleLabel;

@property (strong, nonatomic) UILabel * showTilleLable;

@end

@implementation XXTableiewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{

  static NSString *cellID = @"cellId";

   XXTableiewCell * cell = [[XXTableiewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];

  return cell;

}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

  self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

  if(self){

    [self setViewUI];

  }

  return self;

}

- (void)setViewUI{

  _titleLabel = [[UILabel alloc] init];

  _titleLabel.font = [UIFont systemFontOfSize:XXTableiewCell_fontSize];

  _titleLabel.textColor = [UIColor grayColor];

  _titleLabel.textAlignment = NSTextAlignmentLeft;

  _titleLabel.backgroundColor = [UIColor clearColor];

  [self.contentView addSubview:_titleLabel];

  _showTilleLable = [[UILabel alloc] init];

  _showTilleLable.font = [UIFont systemFontOfSize:XXTableiewCell_fontSize];

  _showTilleLable.textColor = [UIColor grayColor];

  _showTilleLable.textAlignment = NSTextAlignmentLeft;

  _showTilleLable.backgroundColor = [UIColor clearColor];

  [self.contentView addSubview:_showTilleLable];

}

- (void)layoutSubviews{

  [super layoutSubviews];

  _titleLabel.frame = CGRectMake(10, 0, self.contentView.frame.size.width-20, 20);

  _showTilleLable.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.size.height + _titleLabel.frame.origin.y + 5, _titleLabel.frame.size.width, _titleLabel.frame.size.height);

}

@end

@interface ViewController () <UITableViewDataSource, UITableViewDelegate>

@property (strong,nonatomic)NSMutableArray * resultArry;

@end

@implementation ViewController

- (void)viewDidLoad {

  [super viewDidLoad];

  _resultArry = [NSMutableArray arrayWithArray:[UIFont familyNames]];

  UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];

  tableView.dataSource = self;

  tableView.delegate = self;

  [self setExtraCellLineHidden:tableView];

  [self.view addSubview:tableView];

}

// 隱藏多余cell

-(void)setExtraCellLineHidden: (UITableView *)tableView

{

  UIView *view = [UIView new];

  view.backgroundColor = [UIColor clearColor];

  [tableView setTableFooterView:view];

}

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

{

  return _resultArry.count;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

 XXTableiewCell * cell = [XXTableiewCell cellWithTableView:tableView];

  cell.titleLabel.text = [NSString stringWithFormat:@"%ld",(NSInteger)indexPath.row + 1];

  cell.showTilleLable.text = [NSString stringWithFormat:@"%@",_resultArry[indexPath.row]];

  return cell;

}

#pragma mark-設(shè)置每一組的高度

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

{

  return 50;

}

#pragma mark 設(shè)置選中處理方法

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

  NSLog(@"%ld",indexPath.row + 1);

}

- (void)didReceiveMemoryWarning {

  [super didReceiveMemoryWarning];

  // Dispose of any resources that can be recreated.

}

以上是“iOS中tableView的分類有哪些”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

新聞名稱:iOS中tableView的分類有哪些-創(chuàng)新互聯(lián)
路徑分享:http://www.aaarwkj.com/article26/ddogcg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、電子商務(wù)用戶體驗(yàn)、營銷型網(wǎng)站建設(shè)關(guān)鍵詞優(yōu)化、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)
国产又粗又长又猛又爽视频| 日本一区二区精美视频| 男女午夜激情啪啪视频| 国语对白精品视频在线| 无套内谢少妇高朝毛片| 国产精品国产三级国产av野外| 加勒比视频在线观看一区| 亚洲中文字幕av每天更新| 一区二区三区艳情播放| av黄色在线播放网页| 国产精品自在线拍亚洲另类| 久热99在线视频免费观看| 一区二区三区视频免费观看| 国产日韩精品在线视频| 国产三级黄色片免费看| 国产精品推荐在线观看| 蜜桃免费观看在线视频| 日本精品视频免费网| 亚洲第一精品国产日韩| 小明久久国内精品自线| 最新91精品手机国产在线| 久久精品国产一区二区三区91| 成人爱爱在线视频免费观看| 日韩视频看看色网站| 日本人妻久久中文字幕精品| 青青草原免费在线观看| av成人黄色片在线播放| 日韩国产亚洲欧美国产| 中文字幕有码精品在线| 免费观看黄片视频在线播放| av黄色资源在线观看| 中文字幕有码高清在线| 91精品婷婷国产综合| 免费毛片一区二区三区四区| 亚洲精品成人在线国产| 999热这里只有精品视频| 国产乱国产乱老熟女视频| 成人免费视频国产免费| 欧美日韩亚洲高清专区| 91出品国产福利在线| 国产亚洲国产av网站在线|