简体   繁体   English

如何在表格视图单元格中增加文本标签和详细文本标签之间的空间?

[英]How to increase space between text label and detail text label in table view cell?

How to increase space between text label and detail text label in table view cell? 如何在表格视图单元格中增加文本标签和详细文本标签之间的空间?

I want to do this programmatically. 我想以编程方式执行此操作。

My updated answer) 我更新的答案)

I suspect you are using a standard UITableViewCell. 我怀疑您正在使用标准的UITableViewCell。

You should create your own subclassed UITableViewCell and put the labels on them directly with as much space as you want between them. 您应该创建自己的子类UITableViewCell并直接在标签上放置标签,标签之间要留有足够的空间。

My original answer) 我的原始答案)

If you're doing this programatically (you're not clear if you're doing this as an Objective-C/Cocoa app), you can adjust row height via: 如果您以编程方式进行此操作(尚不清楚是否以Objective-C / Cocoa应用程序的身份进行此操作),则可以通过以下方式调整行高:

UITableViewDelegate's tableView:heightForRowAtIndexPath: method UITableViewDelegate的tableView:heightForRowAtIndexPath:方法

or 要么

UITableView's rowheight property UITableView的rowheight属性

In Interface Builder (built into XCode 4.2 instead of being a separate app), you can also adjust the row height property in the Size inspector. 在Interface Builder(内置于XCode 4.2中,而不是作为一个单独的应用程序)中,您还可以在“大小”检查器中调整行高属性。

As far as I can understand, you want to increase the space between two cells and want to increase the width of separator line which is between the cells. 据我了解,您想要增加两个单元格之间的空间,并希望增加单元格之间的分隔线的宽度。

If you are looking for something readymade in form of some method or delegate, it is not available... you have to write your own trick for this one...!! 如果您正在寻找某种方法或委托形式的现成产品,则不可用...您必须为此编写自己的技巧...!

Best of luck...! 祝你好运...!
Sam 山姆

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 表格视图单元格的多行详细文本标签 - Multiple lines in detail text label of table view cell 如何根据表视图单元格的详细文本标签,将segue设置为与表视图控制器不同的视图控制器? - How can I set a segue to a different view controller from a table view controller, based on the detail text label of the table view cell? 使用自动布局表格视图时,如何增加表格视图单元格中的标签高度(取决于文本)? - How to increase Label Height(Depend on Text) in Tableview cell when used Autolayout Table view? 如何更改表格视图单元格文本标签的颜色 - How to change table view cell text label color 表格视图单元格标签文本(列文本)用作链接 - Table View Cell Label text (Column text) use as a link 标签文本增加时,如何以编程方式增加集合视图单元格的高度? - How to programmatically increase collection view cell height when label text increases? UINavigationBar详细信息文本标签 - UINavigationBar detail text label 表视图上的动态单元格高度中的标签未正确显示文本 - Label in dynamic cell height on table view not showing text properly 如何使用表格视图单元格中的文本并将其显示为父视图控制器中的标签? - How can I use text from a table view cell and display it as a label in a parent view controller? 如何使用CoreData从选定的集合视图单元格中获取标签文本? - How to Get Label Text from Selected Collection View Cell with CoreData?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM