heightforrowatindexpath

UITableView separators drawn incorrectly through cell reuse?

我只是一个虾纸丫 提交于 2020-01-13 09:15:42
问题 I'm working on an iOS 5 project with storyboards, and thus using dynamic table cell prototypes in IB. In one of the views, I've got a table view with variable-height cells, with the cell height calculated from the height of the contents. tableView:heightForRowAtIndexPath: returns correct values for all cells when the table view is first displayed. All is well when scrolling down for a few items, but then something goes amiss: the actual cells seem to be correct height, including their touch

heightForRowAtIndexPath being called for all rows & how many rows in a UITableView before performance issues?

感情迁移 提交于 2019-12-29 04:20:44
问题 I thought I had read that for a UITableView that heightForRowAtIndexPath doesn't get called on all rows, but only on the ones that will be visible. This isn't what I'm seeing however. I'm seeing hundreds of calls to heightForRowAtIndexPath for the simple situation of the orientation being changed of the iPhone for example. So I'm assuming here therefore that for a UITableView with heightForRowAtIndexPath implemented, it does (i.e. heightForRowAtIndexPath ) get called for all rows (not just

How can I modify the heightForRowAtIndexPath so that it adjust height to the textview in it,but also keep the minimum height when textview is empty?

▼魔方 西西 提交于 2019-12-25 07:20:01
问题 I have a tableView with static cells inside. One cell contains a map, UITextView and other controls: This textview has the following constraints: So far I set up the heightForRowAtIndexPath to the static value for this cell: func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { if indexPath.row == 0 { return 311; } } but then when the text is longer, the textview - instead of growing - contains the text inside and user has to scroll it. Basically

Hide a UITableView by setting row height to 0?

蹲街弑〆低调 提交于 2019-12-23 13:15:48
问题 I just inherited code which hides/shows rows a UITableView by using the delegate heightForRowAtIndexPath method and returning height 0 for "hidden rows". The code works, but it has me concerned there might be fraught with unforeseen complications. Can someone either ease my concerns or give me good reasons why this could cause problems (I couldn't find any issues with initial testing). The table is fairly small <10 rows total and would require custom row heights even without this hidden row

heightForRowAtIndexPath crashing intermittently

落花浮王杯 提交于 2019-12-20 05:50:57
问题 I have an app with about 30 active users and 500+ registered users and this issue is only happening with one person who is on 9.2 using an iPhone 6. I can see from crash reports she's had over 60 crashes and she has said that the problem is OK sometimes and not others. I have the same test device here and no issue is happening. I can't get much out of the crash report details from fabric but the crash is happening at the following method and the app is crashing at the final else of this

Iphone - when to calculate heightForRowAtIndexPath for a tableview when each cell height is dynamic?

左心房为你撑大大i 提交于 2019-12-17 08:12:53
问题 I have seen this question asked many times but astoundingly, I have not seen a consistent answer, so I will give it a try myself: If you have a tableview containing your own custom UITableViewCells that contain UITextViews and UILabels whose height must be determined at runtime, how are you supposed to determine the height for each row in heightForRowAtIndexPath? The most obvious first idea is to calculate the height for each cell by calculating and then summing the heights of each view

Iphone - when to calculate heightForRowAtIndexPath for a tableview when each cell height is dynamic?

这一生的挚爱 提交于 2019-12-17 08:12:46
问题 I have seen this question asked many times but astoundingly, I have not seen a consistent answer, so I will give it a try myself: If you have a tableview containing your own custom UITableViewCells that contain UITextViews and UILabels whose height must be determined at runtime, how are you supposed to determine the height for each row in heightForRowAtIndexPath? The most obvious first idea is to calculate the height for each cell by calculating and then summing the heights of each view

An extra view appears in cell when pressing reorder dragger, why?

独自空忆成欢 提交于 2019-12-13 00:26:13
问题 I have an UITableView with varying height, and when pressing reorder control, in the cell view structure a new view appears. Normally it is not a problem, but sometimes its height is quite big, and it overlaps, with cell below. Why this view appears? How can I get rid of it? Or prevent to overlap other cells? 回答1: This view is part of the reorder mechanism and can't be removed. It is used to hide the cell content while you drag a screenshot view above the tableview. If you set the cell

Changing an Int to a CGFloat in Swift to return heightForRowAtIndexPath tableview function

送分小仙女□ 提交于 2019-12-11 09:39:08
问题 I am sure that I am missing something really simple, but I just can't get it to work. I will try to explain better what I am doing to try to help others if they have this same issue. This was my function: func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return (count * 40 + 75) as CGFloat } The above function doesn't work. Thanks to the help I received, I found that this is the way to do it: func tableView(tableView: UITableView,

How do I change the height of a table cell that has already loaded?

情到浓时终转凉″ 提交于 2019-12-10 10:28:50
问题 Currently I have webviews loading in customized uitableview cells. The problem is the web views have variable sizes. In webViewDidFinishLoad I am able to set the size of the web view based on the actual size of the html document just fine. My problem is the table cells which have already had their height set in heightForRowAtIndexPath before the web views having finished loading. How can I change the height of a table cell after it has already been loaded? Ideally I feel like I should be able