您好,登錄后才能下訂單哦!
一、效果圖
二、工程圖
三、代碼。
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)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持億速云。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。