您的位置:首页 > 产品设计 > UI/UE

iphone-common-codes-ccteam源代码 CCUIAlertTextView.m

2012-01-06 09:47 323 查看
//
//  CCUIAlertTextView.m
//  CCFC
//
//  Created by xichen on 11-12-16.
//  Copyright 2011年 ccteam. All rights reserved.
//

#import "CCUIAlertTextView.h"
#import <QuartzCore/QuartzCore.h>

@implementation CCUIAlertTextView

- (id)initWithTitle:(NSString *)title
delegate:(id /*<UIAlertViewDelegate>*/)delegate
cancelButtonTitle:(NSString *)cancelButtonTitle
okButtonTitles:(NSString *)okButtonTitles
{
if(self = [super init])
{
_alertView = [[UIAlertView alloc] initWithTitle:title
message:@"\n"
delegate:delegate
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:okButtonTitles, nil];

_field = [[UITextField alloc] initWithFrame:
CGRectMake(12, 45, 260, 25)];
_field.backgroundColor = [UIColor whiteColor];
_field.layer.cornerRadius = 3.0f;
_field.layer.borderWidth = 2.0f;
_field.delegate = delegate;

[_alertView addSubview:_field];
[_field release];

[[UIApplication sharedApplication] setApplicationSupportsShakeToEdit:FALSE];
}
return self;
}

- (void)dealloc
{
[super dealloc];
}

- (void)show
{
[_alertView show];
[_alertView release];
[_field becomeFirstResponder];
}

- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
}

@end


可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUIAlertTextView.m

github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUIAlertTextView.m
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: