У меня есть abstract class
, который является подклассом UIView
.
Он создает представление о новом UIWindow
и показывает пользователям мой Custom alert
.
У меня есть класс AuthorizationView
, унаследованный от этого абстрактного класса, и он содержит некоторые UITextFields
.
Проблема: эти UITextFields
не отвечают на iOS 7.1 beta
, если я создам их сейчас и отправлю тестировщикам. Старые версии проекта нормально работают (из AppStore) на бета-версии iOS 7.1. Любая версия отлично работает на iOS 6.0 - iOS 7.0. У меня нет возможности проверить это самостоятельно на бета-версии iOS 7.1.
Какие-либо предложения?
UITextField
создание:
fieldUser = [[UITextField alloc] initWithFrame:AUTH_FIELD_USER_FRAME];
[fieldUser setBackgroundColor:kColorClear];
[fieldUser setBorderStyle:UITextBorderStyleNone];
[fieldUser setTextAlignment:NSTextAlignmentLeft];
[fieldUser setKeyboardType:UIKeyboardTypeEmailAddress];
[fieldUser setKeyboardAppearance:[[DatabaseManager sharedInstance] keyboard]];
[fieldUser setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
[fieldUser setAutocorrectionType:UITextAutocorrectionTypeNo];
[fieldUser setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[fieldUser setReturnKeyType:UIReturnKeyNext];
[fieldUser setDelegate:self];
[fieldUser setPlaceholder:NSLocalizedString(@"Window_Login_Placeholder_User", @"")];
[fieldUser setFont:kFontNormal(16.0f)];
[self addSubview:fieldUser];
Абстрактный класс:
#import "AlertWindow.h"
@interface AlertWindow ()
{
CGFloat alpha;
}
@property (nonatomic, strong) UIWindow *window;
@end
@implementation AlertWindow
- (id) init
{
self = [super init];
if (self)
{
alpha = 0.8f;
}
return self;
}
- (id) initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
alpha = 0.8f;
}
return self;
}
- (void) showAnimated:(BOOL)animated_
{
UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[view setBackgroundColor:[UIColor blackColor]];
[view setAlpha:alpha];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.windowLevel = UIWindowLevelAlert;
self.window.backgroundColor = kColorClear;
[self.window addSubview:view];
[self.window addSubview:self];
self.window.alpha = 0.0f;
[self.window makeKeyAndVisible];
if (animated_)
{
__block UIWindow *animationWindow = self.window;
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration animations:^{
animationWindow.alpha = 1.0f;
}];
}
else
{
self.window.alpha = 1.0f;
}
}
- (void) hideAnimated:(BOOL)animated_
{
if (animated_)
{
__block UIWindow *animationWindow = self.window;
[UIView animateWithDuration:UINavigationControllerHideShowBarDuration animations:^{
animationWindow.alpha = 0.0f;
} completion:^(BOOL finished) {
self.window.hidden = YES;
self.window = nil;
}];
}
else
{
self.window.hidden = YES;
self.window = nil;
}
}
- (void) hideAnimated
{
[self hideAnimated:YES];
}
- (void) setBackgroundAplha:(CGFloat)alpha_
{
alpha = alpha_;
}
@end