HOw to change the textview size of one class from another class?
Iam developing one application.In that I crearte a one cell.That cell contain the one label and textview.In another class i use that cell in tableview.When we click on textview,keyboard will appeard and iam trying to change the textview size.But it was not changing.So please tell me how to solve this one.Methods iam using for creating the cell are below.
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
lbl=[[UILabel alloc]init];
lbl.font = [UIFont boldSystemFontOfSize:17];
txtview=[[UITextView alloc]init];
txtview.editable=YES;
开发者_如何学Go //txtview.delegate=self;
txtview.font=[UIFont italicSystemFontOfSize:13];
txtview.backgroundColor=[UIColor clearColor];
txtview.enablesReturnKeyAutomatically=YES;
[self.contentView addSubview:lbl];
[self.contentView addSubview:txtview];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
lbl.frame=CGRectMake(7,10, 320, 20);
txtview.frame=CGRectMake(0,25, 320,339);
}
Don't set the frame of your textview in customcell. Rather than that set the frame while you are creating cell in your class
cell.txtview.frame=CGRectMake(0,25, 320,339);
精彩评论