大夏VIEW使用技巧

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值