uitableview

How to change cell height dynamically in UITableView static cell

廉价感情. 提交于 2020-01-11 05:06:06
问题 I am using UITableViewController instead detailView to show one entity details. I populated one row of data from PFQuery in my viewDidLoad method. I have one cell where I am using label, I want to change the size as per NSString size. I checked a lot of answers but all are related to indexPath which is for dynamic and I have static cells. My label showing complete string, but my cell is fixed. How can I change the height of the cell? Please help me to correct this problem. Here is my code: -

iOS swift UIImageView change image in tableView cell

Deadly 提交于 2020-01-11 04:19:06
问题 I have a strange problem in tableView Custom cell . for like Image action I write these code in Custom cell called FeedViewCell : self.like.isUserInteractionEnabled = true let CommenttapGestureRecognizer = UITapGestureRecognizer(target:self, action:#selector(likehandleTap)) self.like.addGestureRecognizer(CommenttapGestureRecognizer) func likehandleTap(_ sender: UITapGestureRecognizer) { if self.like.image == UIImage(named: "like-btn-inactive") { self.like.image = UIImage(named: "like-btn

Variable Height of TextView In TableView Cell

﹥>﹥吖頭↗ 提交于 2020-01-11 03:48:08
问题 I have a basic UITableView , that I fill with a web service online, but I can't find a way to set the height of my cells (dynamic numbers of cells) according to the height of my textView . Here's how I fill my cell : UITextView *textView = (UITextView *)[cell viewWithTag:106]; textView.text = [[stories objectAtIndex:indexPath.row] objectForKey:@"texte"]; in my cellForRow methods : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath I tried

dequeueReusableCellWithIdentifier:forIndexPath: VS dequeueReusableCellWithIdentifier:

孤人 提交于 2020-01-11 02:28:45
问题 I have read this question and think that I understand the difference between the two methods until I find a strange example: Set table view cell's style be Basic , Identifier be Cell in Storyboard, code as below: import UIKit class TableViewController: UITableViewController { var items: [String]! override func viewDidLoad() { super.viewDidLoad() items = ["first", "second", "third"] } override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView

Cancel local notification not working

天涯浪子 提交于 2020-01-11 02:21:26
问题 I've spent half of my day reading all "How to cancel a local notification" questions and answers. After all, I came up with my own solution but apparently it is not working. I have a tableview with all my scheduled notifications.... on the H file I have @property (strong, nonatomic) UILocalNotification *theNotification; and then on the M file: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *notificationArray = [[UIApplication

iOS 7 beginUpdates endUpdates inconsistent

情到浓时终转凉″ 提交于 2020-01-11 02:03:26
问题 Edit : The solution for this answer is related to iOS7 sometimes returning NSIndexPath and other times returning NSMutableIndexPath . The issue wasn't really related to begin/endUpdates , but hopefully the solution will help some others. All - I'm running my app on iOS 7, and I'm running into problems with the beginUpdates and endUpdates methods for a UITableView . I have a tableview that needs to change the height of a cell when touched. Below is my code: - (CGFloat)tableView:(UITableView *

UIRefreshControl not showing spiny when calling beginRefreshing and contentOffset is 0 [duplicate]

邮差的信 提交于 2020-01-11 00:44:07
问题 This question already has answers here : UIRefreshControl - beginRefreshing not working when UITableViewController is inside UINavigationController (14 answers) Closed 6 years ago . I am not able to see the loading spinner when calling beginRefreshing [self.refreshControl beginRefreshing]; My UITableViewController subclass uses a UIRefreshControl // refresh UIRefreshControl * refreshControl = [UIRefreshControl new]; [refreshControl addTarget:self action:@selector(refreshTableView)

My data changes in UITableViewCell when I scroll down and get back

浪尽此生 提交于 2020-01-10 19:59:42
问题 When I'm populating new data in my tableView Controller, my top cell is being rewrite by the bottom one. Let me explain. I have one image that is loading async in the latest cell row, in the bottom. All the other cells are loading static with an image that is in the app. When I scroll down my app and display my bottom cell which have a different image than the others cells, and I scroll up again, I see the first shop image has changed to the dynamic one loaded in the bottom cell. Does anyone

How to create a layout like Featured page in App Store?

♀尐吖头ヾ 提交于 2020-01-10 19:41:11
问题 I'm new in iOS development. Based on my assumption, Feature page in App Store was created using a combination of UITableView and UICollectionView. But how to do that in theory and code? I know it's a bit vague, because it's quite hard to describe it, but I just need some people to help me explain it. For this case I will try to use these naming: 1. Top section, it's a view which showing banners of apps, people can swipe it to view another banner. 2. Middle section, views which can be scrolled

iOS 7.1 beta5 tableviewcell height showing objects outside it's range

陌路散爱 提交于 2020-01-10 19:34:11
问题 I have an app that has a list of UITableViewCells. By default, the cells are set to a certain height (lets say 100) to show only some basic information. When the user clicks on a cell the height changes to 150 to show more actions that were previously not seen. This works without a problem on iOS 7.0.0-7.0.5. I'm testing on an iPhone 5s running iOS 7.1 beta 5 and seeing some drawing issues with the cells. Here's how it looks on iOS 7.0... versions which is what is expected. When the cell is