草庐IT

accessoryType-detailTextLabel

全部标签

ios - 当单元格文本标签太长时,UITableViewCell detailTextLabel 文本消失

当我的TableViewCell中的文本非常长时,detailTextLabel就会消失。我知道UILineBreakModeTailTruncation已被iOS6弃用,所以我尝试了这个:cell.textLabel.lineBreakMode=NSLineBreakByTruncatingTail;那没用。有什么建议吗?编辑:在我的Storyboard中detailTextLabel设置为“RightDetail”,即UITableViewCellStyleValue1。 最佳答案 这似乎是Value1类型单元格的工作方式。文本

ios - detailTextLabel 不显示,即使使用 UITableViewCellStyleSubtitle

我试图让副标题显示在我的表格View的单元格中,但由于某种原因它没有出现。我将单元格的样式设置为UITableViewCellStyleSubtitle,所以这不是问题所在。这是相关代码:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier=@"Cell";UITableViewCell*cell=[tableViewdequeueReusableCellWithIdentifier:C

ios - 使用自动布局模仿 UITableViewCellStyleValue1 accessoryType-detailTextLabel 间距?

当使用带有UITableViewCellStyleValue1的默认UITableViewCell时,detailTextLabel知道accessoryType。标签和单元格边缘之间的距离不同于标签和accessoryTypeView之间的距离。当我使用自定义UITableViewCell子类时,两个距离相等。这看起来不如默认实现好。解释起来有点费劲,截图如下:前两个单元格是带有UITableViewCellStyleValue1的默认UITableViewCell。单元格3和4是使用H:[label]-16-|约束设置的自定义单元格。单元格5和6是使用Trailing-0-Trai

iphone - 如何在 iphone 的 tableview 中找到 accessoryType 单击

我需要在accessoryType上做一些事情,在iphone的tableview中单击。如何找到accessoryType在iphone中的UITableView单击。p> 最佳答案 你需要定义单元格的accessoryType-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath像这样cell.accessoryType=UITableViewCellAccessoryDetailDiscl

ios - Swift - 如何更改 accessoryType (disclosureIndicator) 的颜色?

我对单元格的accessoryType有疑问。我正在使用带有disclosureIndicator作为accessoryType的单元格,我想更改它的颜色,但我不能。有谁知道这是一个错误还是Apple强制我使用灰色?其实我可以改变其他accessoryType的颜色。我的代码是这样的:letcell=tableView.dequeueReusableCell(withIdentifier:"identifier",for:indexPath)as!customCellcell.tintColor=UIColor.redcell.accessoryType=.disclosureIndi

ios - 加载时不显示 UITableViewCell.detailTextLabel

我正在加载一个UITableViewController,我有以下内容:overridefuncviewWillAppear(animated:Bool){nameCell.detailTextLabel?.text=ApplicationUser.sharedInstance.profile.getFullName()!}如果我在进行上述调用后println(nameCell.detailTextLabel?.text),则值设置正确。在第一次显示屏幕时,该值不显示,但是如果我导航到详细View然后返回到该屏幕,该值将按预期显示。为什么?我正在模拟iPhone5s。

ios - Swift UITableViewCell detailTextLabel.text 抛出错误 'fatal error: Can' t unwrap Optional.None'

这是生成表格View的Swift代码。我正在尝试设置带有详细信息标签的tableView。我相信问题的产生是因为if(cell==nil){println("1")cell=UITableViewCell(style:.Subtitle,reuseIdentifier:"CellSubtitle")//cell=tableViewCell}永远不会被调用,因此单元格永远不会使用UITableViewCellStyle.Subtitle样式进行初始化。以下是该方法所需的代码:functableView(tableView:UITableView!,cellForRowAtIndexPat

ios - 自动布局在计算 UITableViewCell 高度时忽略多行 detailTextLabel(所有样式)

所以我尝试使用内置的UITableViewCell样式-特别是UITableViewCellStyleSubtitle-带有(单)行textLabel但多行detailTextLabel。但是(自动)计算的单元格高度始终太短,并且似乎忽略了超过1行的详细信息。我已经尝试使用numberOfLines=0、estimatedRowHeight、UITableViewAutomaticDimension、preferredMaxWidthLayout等,但在所有排列中,行为-实际上对于所有UITableViewCell样式-是否出现UITableViewAutomaticDimension

ios - 自动布局在计算 UITableViewCell 高度时忽略多行 detailTextLabel(所有样式)

所以我尝试使用内置的UITableViewCell样式-特别是UITableViewCellStyleSubtitle-带有(单)行textLabel但多行detailTextLabel。但是(自动)计算的单元格高度始终太短,并且似乎忽略了超过1行的详细信息。我已经尝试使用numberOfLines=0、estimatedRowHeight、UITableViewAutomaticDimension、preferredMaxWidthLayout等,但在所有排列中,行为-实际上对于所有UITableViewCell样式-是否出现UITableViewAutomaticDimension

ios - UITableViewCell detailTextLabel 未显示

在Swift中使用UITableView及其UITableViewCell。我在显示UITableViewCell的detailTextLabel字段时遇到一些问题。我已经找到了这两个有用的帖子,但无法获得完全有效的解决方案:swiftdetailTextLabelnotshowingupHowtoSetUITableViewCellStyleSubtitleanddequeueReusableCellinSwift?这是我正在使用的代码,与我的问题相关:overridefuncviewDidLoad(){super.viewDidLoad()………….theTableView=UIT