关闭

文章标题

30人阅读 评论(0) 收藏 举报

//
// ReleaseCell.h
// wutongwang
//
// Created by hdkj005 on 15/12/10.
// Copyright (c) 2015年 handong001. All rights reserved.
//

import

import “ReleaseCell.h”

@implementation ReleaseCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

    [self.contentView addSubview:self.nameLable];
    [self.contentView addSubview:self.textField];
}
return self;

}

-(UILabel *)nameLable{

if (!_nameLable) {
    _nameLable=[[UILabel alloc] initWithFrame:CGRectMake(15, 0, 100, 50)];
    _nameLable.textColor=[UIColor hexStringToColor:@"666666"];
    _nameLable.textAlignment=NSTextAlignmentLeft;
    _nameLable.font=[UIFont systemFontOfSize:15];

// [_nameLable sizeToFit];
[self.contentView addSubview:_nameLable];
}
return _nameLable;

}

-(UITextField *)textField{

CGFloat textFieldX=CGRectGetMaxX(self.nameLable.frame);
if (!_textField) {
    _textField=[[UITextField alloc] initWithFrame:CGRectMake(textFieldX, 0,ScreenSize.width-textFieldX-30 , 50)];

// _textField.enabled=NO;
_textField.textAlignment=NSTextAlignmentRight;
[_textField setValue:[UIColor hexStringToColor:@”cccccc”] forKeyPath:@”_placeholderLabel.textColor”];
[_textField setTextColor:[UIColor hexStringToColor:@”333333”]];
[_textField addTarget:self action:@selector(changeText:) forControlEvents:UIControlEventEditingChanged];
[self.contentView addSubview:_textField];
}
return _textField;
}

-(void)changeText:(UITextField *)textFied{

if ([self.TextFieldDelegate respondsToSelector:@selector(textFieldTextChanged:)]) {

    [self.TextFieldDelegate textFieldTextChanged:textFied];
}

}

  • (void)awakeFromNib {
    // Initialization code
    }

  • (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
    }

@end

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:75次
    • 积分:21
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档
    阅读排行
    评论排行