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

//  
// 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

 

posted @ 2012-01-06 09:47  cc_team  阅读(184)  评论(0编辑  收藏  举报