问题标签 [detailtextlabel]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
310 浏览

ios - 当 detailTextLabel 变为多行时,TextLabel 向上移动

我目前正在制作一个应用程序,其中 suer 选择MKMapView注释,然后注释(pin)的标题detailtextLabel在 Right Detail中设置为 a UITableViewCell。我的问题是当文本很大时,detailTextLabel变成多行。当这种情况发生时TextLabel,单元格(左边的那个)向上移动。这是我试过的:

  • 在 cellForRowAtIndexPath 方法中,我尝试通过以下代码调整框架:
    CGRect frame = cell.textLabel.frame;

    frame.origin.y = cell.frame.size.height/2;

    cell.textLabel.frame = frame;

    单元格在哪里UITableViewCell设置为正确的细节

  • 子类化单元格并尝试调整框架中的-(void)layoutSubviews

如何阻止它上升并将其保持在单元格的中心?

0 投票
1 回答
81 浏览

ios - 等效于 tableData = [NSArray arrayWithObjects: - iOS 的详细文本

我想知道如何使用类似于的 NSArray 设置单元格的详细信息文本

我不确定这是否可能,但这个很棒的社区肯定能找到一些东西:D

0 投票
2 回答
3083 浏览

uitableview - 表格视图中的文本标签太长,影响正确的细节(detailTextLabel)被覆盖或不显示

我已经为该单元格设置了一个文本,但是,它显示的文本太长,这会影响正确的细节文本被覆盖或不显示。

我无法更改它,因为我需要下一个视图控制器中的名称。是否可以让它只显示文本,后跟“....”?

例子:

电气电子工程...... 01 >

图例:“Electrical & Electronic Engi....”作为表格视图中显示的文本,“01”作为右侧的 detailTextLabel,“>”作为导航。

应该是这个样子, http: //oi58.tinypic.com/2j4vg5k.jpg,但是由于有些文字太长,所以出现了:http: //oi58.tinypic.com/erc177.jpg

textLabel 和 detailTextLabel 似乎不适合或显示在整行中。我希望正确的 detailTextLabel 仍然存在,textLabel 将以“....”结尾

谢谢。

(我是 iOS 编程新手)

0 投票
3 回答
6069 浏览

ios - IOS Multiple right and left align on same line

I want to write on the same line of my tableview cell detailTextLabel.

For example Left string right string.

I'm doing this :

If I add a \n between date and share attribute string, the result is good.

But i want to have two string on the same line..

An idea ?

Thanks

0 投票
1 回答
607 浏览

ios - UITableView 中 cell.detailTextLabel 的法语口音(Objective-C)

我有一个我无法处理的问题。

在我的应用程序中,我从我的 Web 服务以 JSON 格式获取数据。它是 UTF8 编码的,当我填充 UITableView 时一切正常(NSLog 返回重音符号,如:“\u00e9”,但我的 UITableView 显示为:“é”)。

但是当我在 detailTextLabel 中设置相同的数据时,它不会将 "\u00e9" 转换为 "é" ...

尝试了一些编码技巧,但没有任何说服力。

解析方法:

康复:

提前致谢 !

0 投票
2 回答
259 浏览

ios - UITableViewCell's detailTextLabel not use all the available space

As shown in the screenshot

As shown in the screenshot. Just wondering how can I ask the detailTextLabel to make use all of the available space, say, the area of the red rect. I tried to set the frame of the detailTextLabel to make the width bigger which just doesn't work.

Thank you in advance.

0 投票
1 回答
1148 浏览

ios - 如何将数组中的文本添加到情节提要中的文本标签中?

我有一个故事板,其中有两个标签UITableViewCell

标题和价格。

在我的ViewController.m我有一个包含数据的数组(来自 JSON 中的 url)。我得到了我需要的一切,但是当我想将此数据添加到标签中时,我尝试了这样的事情:

  • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellIdentifier = @"BasicCell"; UITableViewCell *myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    // 获取要显示的位置 Location *item = _feedItems[indexPath.row]; NSString *baseUrl = @"address/to/image"; NSString *urlString = [baseUrl stringByAppendingString:item.thumbnail]; NSURL *urla = [NSURL URLWithString:urlString]; NSData * imageData = [NSData dataWithContentsOfURL:urla]; UIImage * image = [UIImage imageWithData:imageData];

    myCell.imageView.image = 图像;

    myCell.detailTextLabel.text = item.elementid; // "'Location' 的不可见@interface 声明选择器'objectAtIndex:' myCell.textLabel.text = item.element; //"'Location' 的不可见@interface 声明选择器'objectAtIndex:'

    返回我的细胞;}

它不起作用,我不知道为什么。我没有收到任何错误信息。谁能帮我?

0 投票
1 回答
402 浏览

ios - DetailTextLabel 在 iOS 8 xcode 6 中不显示

我制作了关于运行 iPhone 5S、Xcode 6 和 iOS 8 的教程。我想在单元格表中显示 textDetailLabel。你能帮我看看这里有什么问题吗?我已经检查了语法,但它不起作用

}

0 投票
1 回答
72 浏览

uitableview - 用 detailTextLabel 找出 UITableViewCells

我想找出所有 UITableViewCells(数量不同),其中有一个 detailTextLabel,其中包含文本“完成”。我怎样才能在 Swift 中做到这一点?

0 投票
13 回答
48286 浏览

uitableview - UITableViewCell 不显示 detailTextLabel.text - Swift

不显示详细信息(副标题)文本。但是,数据是可用的,因为当添加了 println() 调用时,它会将 Optional("data") 与预期的数据一起打印到控制台。在故事板中,UITableViewController 设置为适当的类,Table View Cell Style 设置为“Subtitle”,重用标识符设置为“cell”。如何获取要显示的字幕信息?