#import <UIKit/UIKit.h>
创新互联公司是一家专注于成都网站制作、网站设计与策划设计,阿巴嘎网站建设哪家好?创新互联公司做网站,专注于网站建设十多年,网设计领域的专业建站公司;建站业务涵盖:阿巴嘎等地区。阿巴嘎做网站价格咨询:028-86922220@interface LTView : UIView
#warning 创建需要的属性
@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 第三步,创建视图
- (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;
}
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享题目:自定义视图窗口控件-创新互联
本文来源:https://www.cdcxhl.com/article48/dhpchp.html
成都网站建设公司_创新互联,为您提供网站策划、网站导航、静态网站、网站营销、Google、小程序开发
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联