iOS自動生成表格效果的實現(xiàn)代碼
更新時間:2017年03月27日 14:07:19 作者:弦外雨
這篇文章主要為大家詳細介紹了iOS自動生成表格效果的實現(xiàn)代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
一、效果圖

二、工程圖

三、代碼。
RootViewController.h
#import <UIKit/UIKit.h>
#import "LabelOnBackImage.h"
@interface RootViewController : UIViewController
{
LabelOnBackImage *labelFirst;
}
@end
RootViewController.m
#import "RootViewController.h"
@interface RootViewController ()
@end
@implementation RootViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title=@"LabelOnBackImage";
NSArray *titleArray=[NSArray arrayWithObjects:@"姓名",@"年齡",@"班級", nil];
NSArray *contentArray=[NSArray arrayWithObjects:@"lucy",@"20",@"0331", nil];
labelFirst = [[LabelOnBackImage alloc] initWithFrame:CGRectMake(5, 100, 300, 400)
titleArray:titleArray
contentArray:contentArray
titleColor:nil
contentColor:nil];
[self.view addSubview:labelFirst];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
相關(guān)文章
iOS 底部按鈕和應(yīng)用圖標顯示未讀消息(帶數(shù)字)
本文主要介紹了iOS 底部按鈕和應(yīng)用圖標顯示未讀消息的相關(guān)知識。具有很好的參考價值。下面跟著小編一起來看下吧2017-04-04
iOS UIScrollView滾動視圖/無限循環(huán)滾動/自動滾動的實例代碼
這篇文章主要介紹了iOS UIScrollView滾動視圖/無限循環(huán)滾動/自動滾動,需要的朋友可以參考下2017-02-02
IOS AFNetworking的Post失敗及requestSerializer的正確使用
這篇文章主要介紹了IOS AFNetworking的Post失敗及requestSerializer的正確使用的相關(guān)資料,需要的朋友可以參考下2017-05-05
ios獲取數(shù)據(jù)之encodeURI和decodeURI的實例
下面小編就為大家?guī)硪黄猧os獲取數(shù)據(jù)之encodeURI和decodeURI的實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-11-11
iOS程序開發(fā)之使用PlaceholderImageView實現(xiàn)優(yōu)雅的圖片加載效果
這篇文章主要介紹了ioS程序開發(fā)之使用PlaceholderImageView實現(xiàn)優(yōu)雅的圖片加載效果的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-09-09

