HDXTextView *remark=[[HDXTextView alloc] initWithFrame:CGRectMake(leftmargin-5,labbackView.top, cellContentView.width-2*leftmargin+10, txtViewHeight)];
remark.tag=indexPath.row;
remark.layer.borderWidth=0.5;
remark.layer.borderColor=[Toolobject hexStringToColor:@"ffffff" ].CGColor;
[cellContentView addSubview:remark];
remark.font=[UIFont systemFontOfSize:12];
remark.placeholder=@"请填写任务异常说明 (必填)";
remark.placeholderColor=[Toolobject hexStringToColor:@"cfcfcf" ];
remark.surplusLblPlaceholderSizelen=500;
remark.surplusLblPlaceholder=@"还可输入500字";
remark.surplusLblPlaceholderColor=[Toolobject hexStringToColor:@"cfcfcf" ];
cellContentView.height=remark.bottom+25;
if(![self isEditingException]){
remark.editable=NO;
remark.placeholder=@"";
remark.textColor=[Toolobject hexStringToColor:@"666666" ];
remark.text=[NSString stringWithFormat:@"异常说明: %@",[dict objectForKey:@"content"]];
cellContentView.height=remark.bottom+5;
}
__weak typeof(remark) weakRemark=remark;
remark.editblock=^(NSString *strcontent){
//修改输入内容
if(self.tableArray.count<=remark.tag){
[weakRemark resignFirstResponder];
return ;
}
NSMutableDictionary *dict=[NSMutableDictionary dictionaryWithDictionary:[self.tableArray objectAtIndex:weakRemark.tag]];
[dict setObject:strcontent forKey:@"content"];
[self.tableArray setObject:dict atIndexedSubscript:weakRemark.tag];
};
转载于:https://www.cnblogs.com/onlyMyRailGun/p/5607775.html
本文详细介绍了如何在iOS应用程序中使用HDXTextView控件,包括设置布局、字体、颜色以及实现文本编辑功能。文章还展示了如何通过编辑块来响应用户输入的内容变更,并将这些变更保存到数据模型中。
1116

被折叠的 条评论
为什么被折叠?



