开发者

Table view cell didn't show the full content

I created a tableview to shows some contents with subtitle.

and I chose the UITableViewCellStyleDefault.

so.in my mind, the table view should like this.

At the space will delete, I used _ the represent space

shopA___________Floor 2

shopB___________Floor 3

shopWithLon开发者_如何学PythongName____Floor 5

however, the output is like this

shopA____Floor 2

shopB____Floor 3

shopW...__Floor 5

but in fact there are lots of space after the subtitle : Floor

how can I put the shop name to left and subtitle to right? so that shopWithLongName can show it's full name.

Thank you professionals


it seems so complicated. Are there any easier options?

after changing to UITableViewCellStyleValue1. It becomes better

shopW....._________Floor5

there are lots of space to show the full text.

why do it show .... instead of the full text??


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{
return [Array count];
}


If by subtitle you mean secondary text you can't use UITableViewCellStyleDefault this cell style only has one text string and one optional image, if you want secondary text you need to look at the documentation for UITableViewCell under the cell styles section and pick the style that you are looking for (http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/c/tdef/UITableViewCellStyle). You might also want to take a look at some of the iOS5 table view stuff, there might be something that would allow you to take more control of the way the cells look.


While preparing the cell better to add two labels.And make frames as your requirement.After that fill those labels with text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜