【发布时间】:2016-01-20 11:29:01
【问题描述】:
在这里我提到了我写的代码,在 UITableViewHeaderFooterView 中滚动和第二次调用文本的方法重叠(滚动多少时间文本正在添加),这里我提到屏幕截图:http://prntscr.com/9sgq7x
_imgViewUser.imageURL = [NSURL URLWithString:modelData.user_image_big];
_lblUserName.text = modelData.posted_by;
_lblTime.text = modelData.posted_time;
if ([modelData.commentArray count])
{
_imgViewUser.imageURL = [NSURL URLWithString:[[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_user_small"]];
NSString *nameStr = @"";
if ([GETVALUE(kUSERID) isEqualToString:[[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_userid"]]) {
nameStr = @"You";
}else {
nameStr = [[modelData.commentArray objectAtIndex:0] valueForKey:@"full_name"];
}
_lblUserName.text = nameStr;
_lblTime.text = [[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_post_time"];
}
NSString *OriginalFrontendText = [[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_text"];
UIFont *font = [UIFont fontWithName:@"Arial" size:13.0];
CGFloat descriptionHeight = [OriginalFrontendText boundingRectWithSize:CGSizeMake(180, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: font} context:nil].size.height;
[[self viewWithTag:tag]removeFromSuperview];
STTweetUserName *commentLbl;
if ([modelData.comments_count intValue] > 1) {
commentLbl = [[STTweetUserName alloc]initWithFrame:CGRectMake(0, 39, self.frame.size.width-10, descriptionHeight) withFont:9.0 attributeTextColor:[UIColor darkGrayColor] name:@"See More"];
commentLbl.text = [NSString stringWithFormat:@"%@See More",[[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_text"]];
}else
{
commentLbl = [[STTweetUserName alloc]initWithFrame:CGRectMake(0, 39, self.frame.size.width-10, descriptionHeight) withFont:9.0 attributeTextColor:[UIColor darkGrayColor] name:nil];
commentLbl.text = [[modelData.commentArray objectAtIndex:0] valueForKey:@"cmt_text"];
}
commentLbl.tag = tag;
if (commentLbl.tag == tag) {
[commentLbl removeFromSuperview];
}
[self addSubview:commentLbl];
commentLbl.detectionBlock = ^(STTweetHotUserName hotWord, NSString *string, NSString *protocol, NSRange range){
showAlert(string, nil, @"OK", nil);
//[self SeeMoreClicked];
};
self.frame = CGRectMake(self.contentView.frame.origin.x, self.contentView.frame.origin.y, self.contentView.frame.size.width, 150);
i am getting overlopping while scrolling
【问题讨论】:
-
您在哪里设置表的页脚视图?是否在某处的 viewWillAppear 方法中?
-
不,在侧面 - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
-
您只是想在页脚视图中设置一个带有一些文本的标签。不是吗?
-
是文本,但我想在文本结尾添加选项作为查看更多,查看更多它将可触摸
标签: ios objective-c xcode6 xcode7