tableviewcell

change image of button in custom cell

淺唱寂寞╮ 提交于 2019-12-08 14:20:06
问题 I want to change the image of button on custom cell,given code changing the image on double click.I want to change image on single click(check and uncheck) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"SimpleTableCell"; SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle]

How to add a button to a table view cell in iOS?

戏子无情 提交于 2019-12-08 13:57:57
问题 I'm creating a productivity app in Swift. I'm not using a prototype cell in the Storyboard as most of it has been written in code already. I'd like to a checkbox button. How would I go about doing that? 回答1: While the answer from Tim is technically correct, I would not advise on doing this. Because the UITableView uses a dequeuing mechanism, you could actually receive a reused cell which already has a button on it (because you added it earlier). So your code is actually adding a 2nd button to

Swift - Items not showing up in my table view with customized cell

风格不统一 提交于 2019-12-08 05:13:55
问题 My array teams is not showing up in my tabe view. I am looking for common problems with this. In the code below I gather data from my firebase and put that data into an array called teams. after I get the teams array I then put that array into two arrays because I have two labels in my custom cell called teamOneLabel and teamTwoLable. So after I do all that I then return how many table cells there should be by dividing the teams array by 2. Then I add the data from the cells into each label.

Stepper on tableview cell (swift)

怎甘沉沦 提交于 2019-12-06 06:47:15
问题 I put stepper both outlets and action into tableview cell and using protocol delegate to connect it to tableview. When i tapped stepper in first row, stepper value appear normaly in first row but its also appear in some random row. how to fix this? TableViewCell protocol ReviewCellDelegate{ func stepperButton(sender: ReviewTableViewCell) } class ReviewTableViewCell: UITableViewCell { @IBOutlet weak var countStepper: UIStepper! @IBOutlet weak var stepperLabel: UILabel! override func

How to maintain cell selection in NSUserDefaults?

爱⌒轻易说出口 提交于 2019-12-06 05:57:30
https://github.com/lminhtm/LMDropdownView How can I save the last selected cell in NSUserDefault? When the application is reopened the selection should be maintained. Currently, the default cell is selected whenever the app opens. - (void)viewDidLoad { [super viewDidLoad]; self.mapTypes = @[@"Standard", @"Satellite", @"Hybrid"]; self.currentMapTypeIndex = 0; self.dropPinButton.layer.cornerRadius = 5; self.removeAllPinsButton.layer.cornerRadius = 5; self.moreButton.layer.cornerRadius = 5; self.moreButton.layer.shadowOffset = CGSizeZero; self.moreButton.layer.shadowOpacity = 0.5; self.moreButton

Not able to add static UITableViewCell into tableview

假装没事ソ 提交于 2019-12-06 05:43:38
问题 As I am new in IOS development I am trying to add CustomeCell into tableView but I can not add it from library. What I am doing is just drag TableView in my ViewController and than drag tableview cell in it but its added as extra view under ViewController 's view not able to add it into tableview. I am stuck here any idea how can I add cell by drag and drop. Screen shot : I know how to add cell by coding but its very lengthy process to add every thing by code. Any guidence will be appreciated

How to reload tableview after delete item in cell Swift 2

假如想象 提交于 2019-12-06 04:05:10
I have a list of accounts in a TableView . After I press a button, an item is deleted. So far so good. How to refresh tableView after deletion? Please find the below screenshot for more information. TableView is in another ViewController, the button to delete is in a ViewControllerCell class cellAccount: UITableViewCell { @IBOutlet weak var imgAccount: UIImageView! @IBOutlet weak var lblNomeAccout: UILabel! @IBOutlet weak var btnDeletar: UIButton! @IBAction func btnDeletar(sender: AnyObject) { print(btnDeletar.titleLabel?.text) if (bdAccount.indexOf((btnDeletar.titleLabel?.text)!) != nil) {

Swift UITextField text clears with button action in TableViewCell

China☆狼群 提交于 2019-12-06 00:02:38
I have recorded my screen and here is the link to it . Going into details I have a tableView section, in which there is a tableviewcell ( PhoneCell ) with two textfields (one is a pickerview input and other a textfield), and an Add Button. When Add button is tapped, I am appending an empty phone to the array of phones (reusing the same PhoneCell) and calling tableView.reloadData() method. The Problem :( Whenever I tap on Add button, the textFields text that I enter is cleared. I would like to retain it and ultimately should be able to save data (number of phones the user entered) when I click

Swipe to delete on a tableView that is inside a pageViewController

时光毁灭记忆、已成空白 提交于 2019-12-05 19:03:57
问题 I've got a tableView inside of a pageViewController and when swiping on a cell to bring up the option to delete the cell the gesture is only recognized under certain circumstances, say you swiped very quickly and aggressively. I imagine this is happening because it's not sure whether the swiping gesture is meant for the pageView or the tableView . Is there a way to specifically determine where the swipe gesture is happening to enable a nice smooth display of the delete button? 回答1: I had the

How can I make the footerview always stay at the bottom in UITableViewController?

廉价感情. 提交于 2019-12-05 17:30:27
问题 I am using a UITableviewcontroller and I want the footer view to always stay at the bottom of the screen. However, the y position of the footer view is changing as per the height of the tableviewcell . How can I always make it stick to the bottom of the screen? 回答1: The tableview footer view would always stay at the bottom of the tableview and would always scroll with it. If you need to make the footer view fixed at the bottom then you can not use a TableViewController .You will have to use