#import
@interface LTView : UIView
#warning 創(chuàng)建需要的屬性
@property (nonatomic, retain) UILabel *mLabel;
@property (nonatomic ,retain) UITextField *mTextField;
@end
#import "LTView.h"
@implementation LTView
#warning 第一步,重寫初始化方法
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self createMyView];
}
return self;
}
#warning 第三步,創(chuàng)建視圖
- (void)createMyView
{
//初始化我們定義的屬性
self.mLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 70, 50)];
self.mLabel.backgroundColor = [UIColor greenColor];
[self addSubview:self.mLabel];
[_mLabel release];
self.mTextField = [[UITextField alloc]initWithFrame:CGRectMake(90, 10, 230, 50)];
self.mTextField.backgroundColor = [UIColor yellowColor];
[self addSubview:self.mTextField];
[_mTextField release];
}
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)dealloc
{
[_window release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
[_window release];
LTView *mView = [[LTView alloc]initWithFrame:CGRectMake(10, 100, 340, 70)];
mView.backgroundColor = [UIColor grayColor];
[self.window addSubview:mView];
[mView release];
return YES;
}
另外有需要云服務(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)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。