最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

iOS開發(fā)中UITableview控件的基本使用及性能優(yōu)化方法

 更新時間:2015年12月14日 09:29:27   作者:文頂頂  
這篇文章主要介紹了iOS開發(fā)中UITableview控件的基本使用及性能優(yōu)化方法,代碼基于傳統(tǒng)的Objective-C,需要的朋友可以參考下

UITableview控件基本使用

一、一個簡單的英雄展示程序

NJHero.h文件代碼(字典轉(zhuǎn)模型)

復(fù)制代碼 代碼如下:

#import <Foundation/Foundation.h>

@interface NJHero : NSObject
/**
 *  頭像
 */
@property (nonatomic, copy) NSString *icon;
/**
 *  名稱
 */
@property (nonatomic, copy) NSString *name;
/**
 *  描述
 */
@property (nonatomic, copy) NSString *intro;

- (instancetype)initWithDict:(NSDictionary *)dict;
+ (instancetype)heroWithDict:(NSDictionary *)dict;
@end

NJViewController.m文件代碼

#import "NJViewController.h"
#import "NJHero.h"

@interface NJViewController ()<UITableViewDataSource, UITableViewDelegate>
/**
 *  保存所有的英雄數(shù)據(jù)
 */
@property (nonatomic, strong) NSArray *heros;
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end


復(fù)制代碼 代碼如下:

@implementation NJViewController

#pragma mark - 懶加載
- (NSArray *)heros
{
    if (_heros == nil) {
        // 1.獲得全路徑
        NSString *fullPath =  [[NSBundle mainBundle] pathForResource:@"heros" ofType:@"plist"];
        // 2.更具全路徑加載數(shù)據(jù)
        NSArray *dictArray = [NSArray arrayWithContentsOfFile:fullPath];
        // 3.字典轉(zhuǎn)模型
        NSMutableArray *models = [NSMutableArray arrayWithCapacity:dictArray.count];
        for (NSDictionary *dict in dictArray) {
            NJHero *hero = [NJHero heroWithDict:dict];
            [models addObject:hero];
        }
        // 4.賦值數(shù)據(jù)
        _heros = [models copy];
    }
    // 4.返回數(shù)據(jù)
    return _heros;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // 設(shè)置Cell的高度
    // 當(dāng)每一行的cell高度一致的時候使用屬性設(shè)置cell的高度
    self.tableView.rowHeight = 60;
    self.tableView.delegate = self;
}

#pragma mark - UITableViewDataSource
// 返回多少組
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
// 返回每一組有多少行
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.heros.count;
}
// 返回哪一組的哪一行顯示什么內(nèi)容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 1.創(chuàng)建CELL
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil];
    // 2.設(shè)置數(shù)據(jù)
    // 2.1取出對應(yīng)行的模型
    NJHero *hero = self.heros[indexPath.row];
    // 2.2賦值對應(yīng)的數(shù)據(jù)
    cell.textLabel.text = hero.name;
    cell.detailTextLabel.text = hero.intro;
    cell.imageView.image = [UIImage imageNamed:hero.icon];
    // 3.返回cell
    return cell;
}
#pragma mark - UITableViewDelegate
/*
// 當(dāng)每一行的cell的高度不一致的時候就使用代理方法設(shè)置cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (1 == indexPath.row) {
        return 180;
    }
    return 44;
}
 */

#pragma mark - 控制狀態(tài)欄是否顯示
/**
 *   返回YES代表隱藏狀態(tài)欄, NO相反
 */
- (BOOL)prefersStatusBarHidden
{
    return YES;
}
@end


實現(xiàn)效果:

2015121492425084.png (317×499)

代碼注意點:

(1)在字典轉(zhuǎn)模型的代碼處用下面的代碼,為可變數(shù)組分配dictArray.count個存儲空間,可以提高程序的性能

復(fù)制代碼 代碼如下:

NSMutableArray *models = [NSMutableArrayarrayWithCapacity:dictArray.count];

(2)設(shè)置cell的高度

有三種辦法可以設(shè)置cell的高度

1) 可以在初始加載方法中設(shè)置,self.tableView.rowHeight = 60;這適用于當(dāng)每一行的cell高度一致的時候,使用屬性設(shè)置cell的高度。

2)在storyboard中設(shè)置,適用于高度一致

3)當(dāng)每一行的cell的高度不一致的時候就使用代理方法設(shè)置cell的高度

復(fù)制代碼 代碼如下:

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

{

    if (1 == indexPath.row) {

        return 180;

    }

    return 44;

}


二、cell的一些屬性

代碼示例:

復(fù)制代碼 代碼如下:

#import "NJViewController.h"
#import "NJHero.h"

@interface NJViewController ()<UITableViewDataSource, UITableViewDelegate>
/**
 *  保存所有的英雄數(shù)據(jù)
 */
@property (nonatomic, strong) NSArray *heros;
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end


復(fù)制代碼 代碼如下:

@implementation NJViewController

#pragma mark - 懶加載
- (NSArray *)heros
{
    if (_heros == nil) {
        // 1.獲得全路徑
        NSString *fullPath =  [[NSBundle mainBundle] pathForResource:@"heros" ofType:@"plist"];
        // 2.更具全路徑加載數(shù)據(jù)
        NSArray *dictArray = [NSArray arrayWithContentsOfFile:fullPath];
        // 3.字典轉(zhuǎn)模型
        NSMutableArray *models = [NSMutableArray arrayWithCapacity:dictArray.count];
        for (NSDictionary *dict in dictArray) {
            NJHero *hero = [NJHero heroWithDict:dict];
            [models addObject:hero];
        }
        // 4.賦值數(shù)據(jù)
        _heros = [models copy];
    }
    // 4.返回數(shù)據(jù)
    return _heros;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // 設(shè)置Cell的高度
    // 當(dāng)每一行的cell高度一致的時候使用屬性設(shè)置cell的高度
    self.tableView.rowHeight = 60;
    self.tableView.delegate = self;

}

#pragma mark - UITableViewDataSource
// 返回多少組
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
// 返回每一組有多少行
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.heros.count;
}
// 返回哪一組的哪一行顯示什么內(nèi)容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 1.創(chuàng)建CELL
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil];
    // 2.設(shè)置數(shù)據(jù)
    // 2.1取出對應(yīng)行的模型
    NJHero *hero = self.heros[indexPath.row];
    // 2.2賦值對應(yīng)的數(shù)據(jù)
    cell.textLabel.text = hero.name;
    cell.detailTextLabel.text = hero.intro;
    cell.imageView.image = [UIImage imageNamed:hero.icon];
   
    // 2.3設(shè)置cell的輔助視圖
    // cell.accessoryType =  UITableViewCellAccessoryDisclosureIndicator;
    if (0 == indexPath.row) {
        cell.accessoryView = [UIButton buttonWithType:UIButtonTypeContactAdd];
    }else
    {
        cell.accessoryView = [[UISwitch alloc] init];
    }
//    UIButton *btn = [[UIButton alloc] init];
//    btn.backgroundColor = [UIColor redColor];
//    cell.accessoryView = btn;
   
   
    // 2.4設(shè)置cell的背景顏色
    cell.backgroundColor = [UIColor blueColor];
   
    // 設(shè)置默認狀態(tài)的背景
//    UIView *view = [[UIView alloc] init];
//    view.backgroundColor = [UIColor blueColor];
//    cell.backgroundView = view;
   
    UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"buttondelete"]];
    cell.backgroundView = iv;
   
    // 設(shè)置選中狀態(tài)的背景
    UIView *view2 = [[UIView alloc] init];
    view2.backgroundColor = [UIColor purpleColor];
    cell.selectedBackgroundView = view2;
    // 3.返回cell
    return cell;
}


#pragma mark - 控制狀態(tài)欄是否顯示
/**
 *   返回YES代表隱藏狀態(tài)欄, NO相反
 */
- (BOOL)prefersStatusBarHidden
{
    return YES;
}
@end


實現(xiàn)效果:

2015121492509289.png (320×498)

cell的一些屬性:

(1)設(shè)置cell的輔助視圖,設(shè)置cell.accessoryView(系統(tǒng)提供了枚舉型,也可以自定義@父類指針指向子類對象);

(2)設(shè)置cell的背景顏色,有兩種方式可以設(shè)置cell的背景顏色:

通過backgroundColor 和 backgroundView都可以設(shè)置cell的背景。但是backgroundView 的優(yōu)先級比 backgroundColor的高,所以如果同時設(shè)置了backgroundColor和backgroundView, 那么backgroundView會蓋住backgroundColor

    示例:cell.backgroundColor = [UIColorblueColor];

(3)設(shè)置cell默認狀態(tài)的背景

  示例1:

復(fù)制代碼 代碼如下:

      UIView *view = [[UIView alloc] init];

      view.backgroundColor = [UIColor blueColor];

      cell.backgroundView = view;


  示例2:
復(fù)制代碼 代碼如下:

    UIImageView *iv = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"buttondelete"]];

    cell.backgroundView = iv;(父類指針指向子類對象,可以使用圖片用簡單的操作設(shè)置絢麗的效果)


(4)設(shè)置cell選中狀態(tài)的背景

示例:

復(fù)制代碼 代碼如下:

  UIView *view2 = [[UIView alloc] init];

    view2.backgroundColor = [UIColorpurpleColor];

    cell.selectedBackgroundView = view2;


三、tableview的一些屬性

代碼示例:

復(fù)制代碼 代碼如下:

#import "NJViewController.h"

@interface NJViewController ()<UITableViewDataSource>

@end

@implementation NJViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    // 1.創(chuàng)建tableview
    UITableView *tableview = [[UITableView alloc] init];
    tableview.frame = self.view.bounds;

    // 2.設(shè)置數(shù)據(jù)源
    tableview.dataSource =self;

    // 3.添加tableview到view
    [self.view addSubview:tableview];
   
    // 4.設(shè)置分割線樣式
    // tableview.separatorStyle = UITableViewCellSeparatorStyleNone;

    // 5.設(shè)置分割線顏色
     接收的參數(shù)是顏色的比例值
    tableview.separatorColor = [UIColor colorWithRed:0/255.0 green:255/255.0 blue:0/255.0 alpha:255/255.0];
   
    // 設(shè)置tableview的頭部視圖
    tableview.tableHeaderView = [UIButton buttonWithType:UIButtonTypeContactAdd];
    tableview.tableFooterView = [[UISwitch alloc] init];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 1.創(chuàng)建cell
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];

    // 2.設(shè)置cell的數(shù)據(jù)
    cell.textLabel.text = [NSString stringWithFormat:@"%d", indexPath.row ];

    // 3.返回cell
    return cell;
}

- (BOOL)prefersStatusBarHidden
{
    return YES;
}
@end


實現(xiàn)效果:

2015121492531415.png (319×500)

tableview的一些屬性:

(1)設(shè)置分割樣式(tableview.separatorStyle),這是個枚舉類型

(2)設(shè)置分割線的顏色,可以直接使用系統(tǒng)給出的顏色,如果系統(tǒng)給定的顏色不能滿足需求時,也可以自定義。

  補充:顏色分為24位和32位的,如下

  24bit顏色

     R 8bit 0 ~ 255

     G 8bit 0 ~ 255

     B 8bit 0 ~ 255

    

     32bit顏色

     A 8bit 0 ~ 255(tou)

     R 8bit

     G 8bit

     B 8bit

    

     #ff ff ff 白色

     #00 00 00 黑色

     #ff 00 00 紅色

     #255 00 00

  

設(shè)置為自定義顏色的實例:

復(fù)制代碼 代碼如下:
tableview.separatorColor = [UIColorcolorWithRed:0/255.0green:255/255.0blue:0/255.0alpha:255/255.0];

 //接收的參數(shù)是顏色的比例值


 (3)設(shè)置頂部和底部視圖
復(fù)制代碼 代碼如下:

tableview.tableHeaderView   //頂部

tableview.tableFooterView    //底部


UITableviewcell的性能問題
一、UITableviewcell的一些介紹

UITableView的每一行都是一個UITableViewCell,通過dataSource的 tableView:cellForRowAtIndexPath:方法來初始化每⼀行

UITableViewCell內(nèi)部有個默認的子視圖:contentView,contentView是UITableViewCell所顯示內(nèi)容的父視圖,可顯示一些輔助指示視圖

輔助指示視圖的作⽤是顯示一個表示動作的圖標(biāo),可以通過設(shè)置UITableViewCell的 accessoryType來顯示,默認是UITableViewCellAccessoryNone(不顯⽰示輔助指⽰示視圖), 其他值如下:

復(fù)制代碼 代碼如下:

UITableViewCellAccessoryDisclosureIndicator

UITableViewCellAccessoryDetailDisclosureButton

UITableViewCellAccessoryCheckmark


還可以通過cell的accessoryView屬性來自定義輔助指示視圖(⽐如往右邊放一個開關(guān))

二、問題

  cell的工作:在程序執(zhí)行的時候,能看到多少條,它就創(chuàng)建多少條數(shù)據(jù),如果視圖滾動那么再創(chuàng)建新顯示的內(nèi)容。(系統(tǒng)自動調(diào)用)。即當(dāng)一個cell出現(xiàn)在視野范圍內(nèi)的時候,就會調(diào)用創(chuàng)建一個cell。這樣的邏輯看上去沒有什么問題,但是真的沒有任何問題嗎?

  當(dāng)創(chuàng)建調(diào)用的時候,我們使用nslog打印消息,并打印創(chuàng)建的cell的地址。我們發(fā)現(xiàn)如果數(shù)據(jù)量非常大,用戶在短時間內(nèi)來回滾動的話,那么會創(chuàng)建大量的cell,一直開辟空間,且如果是往回滾,通過打印地址,我們會發(fā)現(xiàn)它并沒有重用之前已經(jīng)創(chuàng)建的cell,而是重新創(chuàng)建,開辟新的存儲空間。

  那有沒有什么好的解決辦法呢?

三、cell的重用原理

(1) iOS設(shè)備的內(nèi)存有限,如果用UITableView顯示成千上萬條數(shù)據(jù),就需要成千上萬 個UITableViewCell對象的話,那將會耗盡iOS設(shè)備的內(nèi)存。要解決該問題,需要重用UITableViewCell對象

(2)重⽤原理:當(dāng)滾動列表時,部分UITableViewCell會移出窗口,UITableView會將窗口外的UITableViewCell放入一個對象池中,等待重用。當(dāng)UITableView要求dataSource返回 UITableViewCell時,dataSource會先查看這個對象池,如果池中有未使用的 UITableViewCell,dataSource則會用新的數(shù)據(jù)來配置這個UITableViewCell,然后返回給 UITableView,重新顯示到窗口中,從而避免創(chuàng)建新對象 。這樣可以讓創(chuàng)建的cell的數(shù)量維持在很低的水平,如果一個窗口中只能顯示5個cell,那么cell重用之后,只需要創(chuàng)建6個cell就夠了。

(3)注意點:還有⼀個非常重要的問題:有時候需要自定義UITableViewCell(用⼀個子類繼 承UITableViewCell),而且每⼀行⽤的不一定是同一種UITableViewCell,所以一 個UITableView可能擁有不同類型的UITableViewCell,對象池中也會有很多不同類型的 UITableViewCell,那么UITableView在重⽤用UITableViewCell時可能會得到錯誤類型的 UITableViewCell

解決⽅方案:UITableViewCell有個NSString *reuseIdentifier屬性,可以在初始化UITableViewCell的時候傳入一個特定的字符串標(biāo)識來設(shè)置reuseIdentifier(一般用UITableViewCell的類名)。當(dāng)UITableView要求dataSource返回UITableViewCell時,先 通過一個字符串標(biāo)識到對象池中查找對應(yīng)類型的UITableViewCell對象,如果有,就重用,如果沒有,就傳入這個字符串標(biāo)識來初始化⼀一個UITableViewCell對象。

圖片示例:

2015121492630136.png (758×461)

說明:一個窗口放得下(可視)三個cell,整個程序只需要創(chuàng)建4個該類型的cell即可。

四、cell的優(yōu)化代碼

 代碼示例:

復(fù)制代碼 代碼如下:

#import "NJViewController.h"
#import "NJHero.h"

// #define ID @"ABC"

@interface NJViewController ()<UITableViewDataSource, UITableViewDelegate>
/**
 *  保存所有的英雄數(shù)據(jù)
 */
@property (nonatomic, strong) NSArray *heros;
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end


復(fù)制代碼 代碼如下:

@implementation NJViewController

#pragma mark - 懶加載
- (NSArray *)heros
{
    if (_heros == nil) {
        // 1.獲得全路徑
        NSString *fullPath =  [[NSBundle mainBundle] pathForResource:@"heros" ofType:@"plist"];
        // 2.更具全路徑加載數(shù)據(jù)
        NSArray *dictArray = [NSArray arrayWithContentsOfFile:fullPath];
        // 3.字典轉(zhuǎn)模型
        NSMutableArray *models = [NSMutableArray arrayWithCapacity:dictArray.count];
        for (NSDictionary *dict in dictArray) {
            NJHero *hero = [NJHero heroWithDict:dict];
            [models addObject:hero];
        }
        // 4.賦值數(shù)據(jù)
        _heros = [models copy];
    }
    // 4.返回數(shù)據(jù)
    return _heros;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // 設(shè)置Cell的高度
    // 當(dāng)每一行的cell高度一致的時候使用屬性設(shè)置cell的高度
    self.tableView.rowHeight = 160;
}

#pragma mark - UITableViewDataSource
// 返回多少組
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
// 返回每一組有多少行
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.heros.count;
}
// 當(dāng)一個cell出現(xiàn)視野范圍內(nèi)的時候就會調(diào)用
// 返回哪一組的哪一行顯示什么內(nèi)容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 定義變量保存重用標(biāo)記的值
    static NSString *identifier = @"hero";
   
//    1.先去緩存池中查找是否有滿足條件的Cell
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
//    2.如果緩存池中沒有符合條件的cell,就自己創(chuàng)建一個Cell
    if (cell == nil) {
        //    3.創(chuàng)建Cell, 并且設(shè)置一個唯一的標(biāo)記
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
        NSLog(@"創(chuàng)建一個新的Cell");
    }
//    4.給cell設(shè)置數(shù)據(jù)
    NJHero *hero = self.heros[indexPath.row];
    cell.textLabel.text = hero.name;
    cell.detailTextLabel.text = hero.intro;
    cell.imageView.image = [UIImage imageNamed:hero.icon];
   
   //  NSLog(@"%@ - %d - %p", hero.name, indexPath.row, cell);
   
    // 3.返回cell
    return cell;
}

#pragma mark - 控制狀態(tài)欄是否顯示
/**
 *   返回YES代表隱藏狀態(tài)欄, NO相反
 */
- (BOOL)prefersStatusBarHidden
{
    return YES;
}
@end


緩存優(yōu)化的思路:

(1)先去緩存池中查找是否有滿足條件的cell,若有那就直接拿來

(2)若沒有,就自己創(chuàng)建一個cell

(3)創(chuàng)建cell,并且設(shè)置一個唯一的標(biāo)記(把屬于“”的給蓋個章)

(4)給cell設(shè)置數(shù)據(jù)

注意點:

定義變量用來保存重用標(biāo)記的值,這里不推薦使用宏(#define來處理),因為該變量只在這個作用域的內(nèi)部使用,且如果使用宏定義的話,定義和使用位置太分散,不利于閱讀程序。由于其值不變,沒有必要每次都開辟一次,所以用static定義為一個靜態(tài)變量。

相關(guān)文章

  • iOS如何獲取漢字(簡體中文)筆畫數(shù)詳解

    iOS如何獲取漢字(簡體中文)筆畫數(shù)詳解

    這篇文章主要給大家介紹了關(guān)于iOS如何獲取漢字(簡體中文)筆畫數(shù)的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • 詳解iOS應(yīng)用開發(fā)中autoresizing尺寸自動適應(yīng)屬性的用法

    詳解iOS應(yīng)用開發(fā)中autoresizing尺寸自動適應(yīng)屬性的用法

    這篇文章主要介紹了iOS應(yīng)用開發(fā)中autoresizing尺寸自動適應(yīng)屬性的用法,文中講解了使用代碼和Storyboard兩種方式調(diào)節(jié)autoresizing的方法,示例代碼為Objective-C,需要的朋友可以參考下
    2016-03-03
  • iOS自定義PageControl的方法示例

    iOS自定義PageControl的方法示例

    這篇文章主要給大家介紹了關(guān)于iOS自定義PageControl的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • iOS仿微博圖片瀏覽器

    iOS仿微博圖片瀏覽器

    這篇文章主要為大家詳細介紹了iOS仿微博圖片瀏覽器的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-11-11
  • iOS緩存文件大小顯示功能和一鍵清理功能的實現(xiàn)方法

    iOS緩存文件大小顯示功能和一鍵清理功能的實現(xiàn)方法

    緩存占用了系統(tǒng)的大量空間,如何實時動態(tài)的顯示緩存的大小,使用戶清晰的了解緩存的積累情況,有效的進行一鍵清理呢?下面小編通過本文給大家介紹iOS緩存文件大小顯示功能和一鍵清理功能的實現(xiàn)方法,一起看看吧
    2016-10-10
  • iOS 斷點上傳文件的實現(xiàn)方法

    iOS 斷點上傳文件的實現(xiàn)方法

    這項目開發(fā)中,有時候我們需要將本地的文件上傳到服務(wù)器,簡單的幾張圖片還好,但是針對iPhone里面的視頻文件進行上傳,為了用戶體驗,我們有必要實現(xiàn)斷點上傳。這篇文章主要介紹了iOS 斷點上傳文件的實現(xiàn)方法,需要的朋友可以參考下
    2017-12-12
  • iOS實現(xiàn)左右可滑動的選擇條實例代碼分享

    iOS實現(xiàn)左右可滑動的選擇條實例代碼分享

    本文通過實例代碼給大家介紹了ios實現(xiàn)左右可滑動的選擇條功能,非常不錯,具有參考借鑒價值,需要的朋友參考下
    2017-03-03
  • IOS實現(xiàn)驗證碼倒計時功能(一)

    IOS實現(xiàn)驗證碼倒計時功能(一)

    這篇文章主要介紹了IOS實現(xiàn)驗證碼倒計時功能,點擊獲取驗證碼,進入時間倒計時,感興趣的小伙伴們可以參考一下
    2016-01-01
  • iOS swift實現(xiàn)轉(zhuǎn)場動畫的方法示例

    iOS swift實現(xiàn)轉(zhuǎn)場動畫的方法示例

    在平時的iOS開發(fā)中,我們進行界面跳轉(zhuǎn)時一般都是采用系統(tǒng)默認的轉(zhuǎn)場動畫,而下面這篇文章主要給大家介紹了關(guān)于iOS利用swift實現(xiàn)轉(zhuǎn)場動畫的方法示例,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-07-07
  • iOS 控件封裝(又名擰螺絲)之排序按鈕的開發(fā)

    iOS 控件封裝(又名擰螺絲)之排序按鈕的開發(fā)

    排序按鈕是實際開發(fā)中比較常見的一種控件,這篇文章主要介紹了iOS 開發(fā)之排序按鈕,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-12-12

最新評論

理塘县| 六枝特区| 台中县| 特克斯县| 商都县| 宜兰县| 巴东县| 互助| 新田县| 锡林郭勒盟| 油尖旺区| 嘉善县| 边坝县| 宝坻区| 久治县| 青冈县| 农安县| 海口市| 新蔡县| 宿迁市| 呼伦贝尔市| 梅州市| 古田县| 唐山市| 宝鸡市| 谷城县| 丹江口市| 大同县| 永仁县| 婺源县| 蒲城县| 沾化县| 新巴尔虎左旗| 富阳市| 西充县| 阳高县| 桐城市| 平塘县| 洪洞县| 邳州市| 金寨县|