custom-cell

Showing a checkmark accessory view move the table contents

北城以北 提交于 2019-12-10 21:25:03
问题 I followed Apple's documentation on adding subview to the UITableViewcell here to add a 3rd label to the cell. The problem is when I show the standard checkmark accessory view on the right the whole cell contents moves left even when I didn't show the 3rd label. Screenshot below . And here is my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"MyCell"; UILabel *mainLabel, *secondLabel,

How do I draw a multi-column UITableView?

霸气de小男生 提交于 2019-12-07 23:58:37
问题 I want to draw a multi-column UITableView like the picture below, which is different than a common Custom Cell. How do I do this? 回答1: Is it horizontally scrollable? It doesn't look so. If it's only vertically scrollable, use a regular UITableView. For each row, you use a UITableViewCell as usual. For each column, just use a UIButton or any widget that you like. In your screenshot, it looks like columns but there is no underlying concept of columns. You can easily create custom UITableView

How to get other control value from UITableViewCell?

二次信任 提交于 2019-12-07 18:36:44
问题 I have one doubt that how to get other control's value when we select a row or tap on button while having custom tableViewCell. Suppose I have a TableView Cell with a TextField, a Slider and button. Button has action using: btn.tag = indexPath.row; [btn addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; Now I can get button on its action method. I need to get textField's value and slider's value on button tap. The one option is I create a array and

Tableview selection hides my button within the tableview cell

▼魔方 西西 提交于 2019-12-07 13:46:58
问题 There is another question with same logic.UITableViewCell subview disappears when cell is selected i did not get correct solution which i want.They suggest to subclass view like that.But i need display button within the cell itself. Lets come to my question: I have a customized and programmatically created tableview. Please take a look at the screenshots. In this i added button programmatically to the tableview cell. Lets come to the problem. When i select any cell it hides the button also,I

PrepareForSegue from a UIButton in a custom prototype cell

痴心易碎 提交于 2019-12-07 11:54:07
问题 As the title say I have a tableView with prototype cell; cell is a custom cell (so I made a class called CustomCell.swift in witch I created the IBOutlet for image, label, button etc); here my class import UIKit class CustomCell: UITableViewCell { @IBOutlet var imageSquadra: UIImageView! @IBOutlet var button: UIButton! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated:

How do I draw a multi-column UITableView?

寵の児 提交于 2019-12-06 08:36:25
I want to draw a multi-column UITableView like the picture below, which is different than a common Custom Cell. How do I do this? Is it horizontally scrollable? It doesn't look so. If it's only vertically scrollable, use a regular UITableView. For each row, you use a UITableViewCell as usual. For each column, just use a UIButton or any widget that you like. In your screenshot, it looks like columns but there is no underlying concept of columns. You can easily create custom UITableView cells by using Interface Builder and loading a custom nib. Look at http://developer.apple.com/library/ios/

How to get other control value from UITableViewCell?

不羁的心 提交于 2019-12-06 04:43:34
I have one doubt that how to get other control's value when we select a row or tap on button while having custom tableViewCell. Suppose I have a TableView Cell with a TextField, a Slider and button. Button has action using: btn.tag = indexPath.row; [btn addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; Now I can get button on its action method. I need to get textField's value and slider's value on button tap. The one option is I create a array and store values for these two control in that array and manage this. But I don't think this is correct way

PrepareForSegue from a UIButton in a custom prototype cell

一笑奈何 提交于 2019-12-06 04:11:52
As the title say I have a tableView with prototype cell; cell is a custom cell (so I made a class called CustomCell.swift in witch I created the IBOutlet for image, label, button etc); here my class import UIKit class CustomCell: UITableViewCell { @IBOutlet var imageSquadra: UIImageView! @IBOutlet var button: UIButton! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } then I made the UITableViewController :

iOS where to put custom cell design? awakeFromNib or cellForRowAtIndexPath?

懵懂的女人 提交于 2019-12-05 18:21:43
So, basically i made a custom cell from a nib, wish i apply a little custom design, like colors and shadows. I found two ways of applying the styling: awakeFromNib(): override func awakeFromNib() { super.awakeFromNib() //Container Card Style self.container.layer.cornerRadius = 3 self.container.setDropShadow(UIColor.blackColor(), opacity: 0.20, xOffset: 1.5, yOffset: 2.0, radius: 1.8) //Rounded thumbnail self.thumb_image.setRoundedShape() self.thumb_image.backgroundColor = UIColor.customGreyTableBackground() //Cell self.backgroundColor = UIColor.customGreyTableBackground() self.selectionStyle =

How to implement comments and reply system in iOS swift

耗尽温柔 提交于 2019-12-05 04:49:34
问题 I have to implement comment and reply system in my application. I am getting the data from the API and I don't understand how to do this cause I have not done anything like this before. I know I have to take two different cells for this type of system but I don't Know how to filter the data for comments and replies and show them in their respective cells. Here is how my JSON: [ { "firstName": "Mark", "lastName": "King", "profilePic": "avatar2 - Copy - Copy.jpg", "reviewId": 54, "userId": 4,