Commit 8b2e7a8c authored by freecui's avatar freecui

登录页

parent a374661b
......@@ -9,7 +9,8 @@
#import "ICRLoginContentView.h"
#import "ICRCheckBox.h"
#define LOGIN_ICON_WIDTH (60)
#define LOGIN_ICON_WIDTH (156)
#define LOGIN_ICON_HEIGHT (44)
#define LOGIN_INNER_GAP (20)
#define LOGIN_INPUT_HEIGHT (50)
......@@ -75,6 +76,52 @@
return v;
}
+ (UIView *)p_textFWithLeftImgView:(NSString *)nsLeftImgName
textF:(UITextField * __autoreleasing *)textFPointer
{
UIView *v = [[UIView alloc] init];
v.backgroundColor = [UIColor clearColor];
UIImageView *txtFBG = [[UIImageView alloc] initWithFrame:v.bounds];
txtFBG.userInteractionEnabled = YES;
txtFBG.image =
[[UIImage imageNamed:@"LoginInputBG"] stretchableImageWithLeftCapWidth:10
topCapHeight:25];
[txtFBG autoresizingWithStrechFullSize];
[v addSubview:txtFBG];
// IBTUILabel *leftLabel = [[IBTUILabel alloc] init];
// leftLabel.font = [UIFont systemFontOfSize:16];
// leftLabel.text = nsLeftLabel;
// [leftLabel sizeToFit];
// leftLabel.x = LOGIN_LABEL_MARGIN;
UIImageView *leftImgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:nsLeftImgName]];
leftImgV.frame = CGRectMake(5, 0, 19, 22);
UIView *labelContainer = [[UIView alloc] init];
labelContainer.backgroundColor = [UIColor clearColor];
labelContainer.frame = (CGRect){
.origin.x = 0,
.origin.y = 0,
.size.width = leftImgV.width + 1 * LOGIN_LABEL_MARGIN,//leftLabel.width + 2 * LOGIN_LABEL_MARGIN,
.size.height = leftImgV.height//leftLabel.height
};
[labelContainer addSubview:leftImgV];
UITextField *txtF = [[UITextField alloc] initWithFrame:txtFBG.bounds];
txtF.leftViewMode = UITextFieldViewModeAlways;
txtF.leftView = labelContainer;
[txtF autoresizingWithStrechFullSize];
[v addSubview:txtF];
if (textFPointer) {
*textFPointer = txtF;
}
return v;
}
#pragma mark - Life Cycle
- (instancetype)initWithFrame:(CGRect)frame
showCCode:(BOOL)bNeedShowCCode
......@@ -107,7 +154,7 @@
.origin.x = (self.width - LOGIN_ICON_WIDTH) * .5f,
.origin.y = 0,
.size.width = LOGIN_ICON_WIDTH,
.size.height = LOGIN_ICON_WIDTH
.size.height = LOGIN_ICON_HEIGHT//LOGIN_ICON_WIDTH
};
self.m_titleLabel.frame = (CGRect){
......@@ -170,33 +217,41 @@
- (void)initSubviews {
self.m_iconView = [[UIImageView alloc] init];
_m_iconView.image = [IBTCommon appIcon];
_m_iconView.image = [UIImage imageNamed:@"logo"];//[IBTCommon appIcon];
[self addSubview:_m_iconView];
self.m_titleLabel = [[IBTUILabel alloc] init];
self.m_titleLabel.font = [UIFont systemFontOfSize:19.0f];
self.m_titleLabel.textColor = [UIColor whiteColor];
self.m_titleLabel.textAlignment = NSTextAlignmentCenter;
self.m_titleLabel.text = [IBTCommon localizableString:@"XFFruit"];
self.m_titleLabel.text = @"移动管理平台";//[IBTCommon localizableString:@"XFFruit"];
[self addSubview:_m_titleLabel];
UITextField *txtF = nil;
// self.m_cCodeView =
// [[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"CompanyCode"] stringByAppendingString:@":"]
// textF:&txtF];
self.m_cCodeView =
[[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"CompanyCode"] stringByAppendingString:@":"]
textF:&txtF];
[[self class] p_textFWithLeftImgView:@"公司识别码" textF:&txtF];
self.m_cCodeTextF = txtF;
[self addSubview:_m_cCodeView];
// self.m_userNameView =
// [[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"User"] stringByAppendingString:@":"]
// textF:&txtF];
self.m_userNameView =
[[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"User"] stringByAppendingString:@":"]
textF:&txtF];
[[self class] p_textFWithLeftImgView:@"profile" textF:&txtF];
self.m_userNameTextF = txtF;
[self addSubview:_m_userNameView];
// self.m_passwordView =
// [[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"Password"] stringByAppendingString:@":"]
// textF:&txtF];
self.m_passwordView =
[[self class] TextFWithLeftLabel:[[IBTCommon localizableString:@"Password"] stringByAppendingString:@":"]
textF:&txtF];
[[self class] p_textFWithLeftImgView:@"password" textF:&txtF];
self.m_passwordTextF = txtF;
_m_passwordTextF.secureTextEntry = YES;
[self addSubview:_m_passwordView];
......@@ -205,7 +260,7 @@
[self initCheckBox];
// button
self.m_loginBtn = [IBTUIButton RoundCornerBtnWithTitle:[IBTCommon localizableString:@"Login"] bgColor:nil];
self.m_loginBtn = [IBTUIButton RoundCornerBtnWithTitle:[IBTCommon localizableString:@"Login"] bgColor:GXF_ORIGIN_COLOR];
[self.m_loginBtn setTitle:[IBTCommon localizableString:@"Login"]
forState:UIControlStateNormal];
[self addSubview:_m_loginBtn];
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "logo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "logo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "password.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "password@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "profile.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "profile@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "公司识别码.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "公司识别码@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -67,7 +67,7 @@
#pragma mark - Private Method
- (void)setupSubviews {
UIImageView *bg = [[UIImageView alloc] initWithFrame:self.view.bounds];
bg.image = [UIImage imageNamed:@"LoginBG"];
bg.image = [UIImage imageWithColor:GXF_SAVE_COLOR];//[UIImage imageNamed:@"LoginBG"];
[bg autoresizingWithStrechFullSize];
UITapGestureRecognizer *tapGesture =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment