in Education by
I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works fine. However there is an issue when I tap on the cell. It gets highlighted, but the nested UITableView changes its color to white which does not look good. Is there any way to change this? I already set the nested UITableView's backgroundView and its cells to transparent. EDIT: Selection is disabled for the nested UITableView. The tap occurs on a cell of the outer UITableView, which makes the whole inner UITableView turn white. EDIT2: Here are some screenshots before and during the tap EDIT3: Code of the first UITableView: In the ViewControler's viewDidLoad self.tableView.delegate = self self.tableView.dataSource = self self.tableView.backgroundColor = UIColor.darkBlueColor() self.tableView.registerNib(UINib(nibName: "TimelineDay", bundle: nil), forCellReuseIdentifier: TimelineDayTableViewCell.identifier) In the TimelineDayTableViewCell's awakeFromNib() self.tableView.delegate = self self.tableView.dataSource = self self.tableView.backgroundColor = UIColor.darkBlueColor() self.tableView.backgroundView = UIView.clearView() self.selectedBackgroundView = UIView.viewWithBackgroundColor(UIColor.accentColor()) self.tableView.registerNib(UINib(nibName: "EventItemCell", bundle: nil), forCellReuseIdentifier: EventItemTableViewCell.identifier) In the EventItemTableViewCell's awakeFromNib() self.backgroundView = UIView.clearView() self.selectedBackgroundView = UIView.clearView() JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You may need to subclass your cell: class YourTableViewCellClass: UITableViewCell { @IBOutlet weak var yourLabel: UILabel! override func setSelected(_ selected: Bool, animated: Bool) { if(selected) { self.contentView.backgroundColor = UIColor.red //or what you want self.yourLabel.textColor = UIColor.green //or what you want } else { self.contentView.backgroundColor = UIColor.white //or what you want self.yourLabel.textColor = UIColor.green //or what you want } } }

Related questions

0 votes
    I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    Recently implemented trailingSwipeActionsConfigurationForRowAt , where after swiping from right to left showing two options ... , JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    Can anyone help me, Im trying to make a simple app where you touch the screen and 4 images are ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    Can anyone help me, Im trying to make a simple app where you touch the screen and 4 images are ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    Hello I am using native UITableViewCell in my UITableView. When I set the image of the cell it looks ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    I make an alarm clock app, and I want when my device is locked and alarm start calling see a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I am using Realm with Swift 3 in my iOS app. I have the following code //Find all records for the day func ... { let predicate = NSPredicate(format: "date >= %@ and date...
asked May 8, 2022 in Education by JackTerrance
0 votes
    I am writing my first iOS application (iPhone only) with Swift. The main application view should allow user ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    Is it possible to get access to dismiss() in an SKScene class? Dismiss is a method available from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I've inherited a codebase that implements a half-baked implementation of custom intents and shortcuts. One ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I'm making a little game and I'am having trouble updating an UILabel I created to display the current ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I have a UITableView of customers where a row/customer is selected. The user can then push another view ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I have a UITableView of customers where a row/customer is selected. The user can then push another view ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    I have a UITableView of customers where a row/customer is selected. The user can then push another view ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
...