如何限制我的aCell.textLabel和aCell.detailTextLabel的寬度。我在textLabel中有一個大字符串,它覆蓋在我的詳細信息字符串上。我試過這個: aCell.textLabel.width = aCell.width - 250;但它不起作用。任何線索。TableViewCell textLabel寬度問題
1
A
回答
1
我就是這麼做的:
UILabel *theTitle = [[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 200, 25)] autorelease];
[theTitle setText:[anObject objectForKey:@"key"];
[theTitle setFont:[UIFont fontWithName:[self textLabelFont] size:[[self textLabelFontSize] floatValue]]];
[aCell.contentView addSubview:theTitle];
1
我不確定這是否是最佳答案,但您可以嘗試在界面構建器中創建自定義UITableViewCell
。這就是我上次所做的,我不得不爲表格單元格做任何不尋常的事情。
DarkDust剛剛發佈本教程中另外一個問題: http://www.e-string.com/content/custom-uitableviewcells-interface-builder
相關問題
- 1. UITableViewCell textLabel寬度不變
- 2. TableViewCell自動高度問題
- 3. html textlabel的高度和寬度不變
- 4. UIDatePicker寬度問題IOS
- 5. 寬度問題
- 6. 如何限制爲textLabel的寬度UITabelViewCell
- 7. 設置爲textLabel的文本tableViewCell
- 8. Divs寬度問題
- 9. Div寬度問題
- 10. IE9寬度問題
- 11. CSS寬度問題
- 12. CCSprite寬度問題
- 13. CSS寬度問題:
- 14. 寬度:100%問題
- 15. Royalslider寬度問題
- 16. Xcode tableViewcell Autolayout問題
- 17. iOS Swift TableviewCell問題
- 18. TableViewCell顏色問題
- 19. TableViewCell對齊問題
- 20. CSS 100%寬度問題
- 21. HR寬度100%問題
- 22. 邊欄寬度問題
- 23. 按鍵寬度問題
- 24. android spinner寬度問題?
- 25. 寬度問題從http://datatables.net/
- 26. IE寬度渲染問題
- 27. 問題與微調寬度
- 28. WPF RibbonTextBox寬度問題
- 29. td文本寬度問題
- 30. WebWorks視口寬度問題