gpt4 book ai didi

ios - UITextView 链接突出显示,但在自定义 UITableViewCell 中时不可单击

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:35:55 25 4
gpt4 key购买 nike

enter image description here

我在自定义 tableviewcell 中获得了这三个 TextView (层次结构的底部)。

enter image description here

这是他们的设置。它们会突出显示正确的内容(电话号码、地址等),但不允许我点击它们。

最佳答案

您可以尝试手动创建 TextView 吗?下面的链接可以点击:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

static NSString* cellIdentify = @"Cell";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];

if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentify];
}

UITextView* textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, 200, 50)];
textView.text = @"12345678 http://haivl.com";
textView.dataDetectorTypes = UIDataDetectorTypeLink;
textView.editable = NO;
textView.selectable = YES;
[cell addSubview:textView];
return cell;

关于ios - UITextView 链接突出显示,但在自定义 UITableViewCell 中时不可单击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22211652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com