uitableview

Self-sizing UICollectionView with UITableView with dynamic header as a cell

ε祈祈猫儿з 提交于 2021-02-11 13:05:38
问题 I have a problem with making a self sizing UICollectionView with a cell that contains UITableView with a header that has a label with dynamic height. Can someone point me out to what I need to change in the attached sample project? You can see on the screenshot that the table does not fit the view as the cell's height is currently manually set. import UIKit class ViewController: UIViewController { static let section1 = "section1" static let section2 = "section2" private weak var

How to move rows in UITableView changing even the section

谁都会走 提交于 2021-02-11 12:29:04
问题 I need to move some row to a different section, let's say to set if some object is inside a list or another (in and out). if the "out" list is empty I'll show a certain cell, otherwise I'll show the normal one. I tested some solutions, but with my code I have two problems, the items in second array are not populating the table, and I cannot keep trace of section while moving. @IBOutlet weak var testTable: UITableView! var globalArray = [["test1", "test2", "test3"], ["out dummy item"]] let

How to vertically overlap and hide labels in a custom UITableView cell with dynamic height and width to reduce cell size and save space

不问归期 提交于 2021-02-11 12:24:04
问题 I have a messaging cell that has 3 rows of UILabel, 1. Sender Name, 2. Message 3. Sent Time. Initially, I was keeping an offset of 10 between each of the labels. But I realized that I was wasting space in cases where either the message was too small or if the message wrapped over to a new line and had empty space on the right. So I decided to move the label showing sent time up to save some of that space for the case where the message was too small. I constraint the container like this:

How to vertically overlap and hide labels in a custom UITableView cell with dynamic height and width to reduce cell size and save space

馋奶兔 提交于 2021-02-11 12:21:19
问题 I have a messaging cell that has 3 rows of UILabel, 1. Sender Name, 2. Message 3. Sent Time. Initially, I was keeping an offset of 10 between each of the labels. But I realized that I was wasting space in cases where either the message was too small or if the message wrapped over to a new line and had empty space on the right. So I decided to move the label showing sent time up to save some of that space for the case where the message was too small. I constraint the container like this:

UITableViewCell gets reused and shows wrong drawing in UIView

人走茶凉 提交于 2021-02-11 12:14:30
问题 I've been having this problem for weeks and I think I am not able to solve it. I have a tableView which has custom tableViewCell s and they are filled with data. The tableViewCell has two UILabel s and one UIView . The problem appears when I scroll several times the drawings on the UIView s are overlapped one with another, I think they are redrawn. I know that this behavior is because of the reuse of the cells but I can't even locate the origin of the problem. UIViews show perfectly when

Use Realm Query Results as UITableView Section Headers

独自空忆成欢 提交于 2021-02-11 09:40:30
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

Use Realm Query Results as UITableView Section Headers

纵饮孤独 提交于 2021-02-11 09:39:02
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

Dynamic Type within Labels of Basic (Static) Cells of UITableViewController - is it possible?

我与影子孤独终老i 提交于 2021-02-11 07:31:04
问题 Question is fairly self explanatory and I may be missing something simple. The following is done in Interface Builder. I have created a UITableViewController, I've set the Content to Static Cells and Style to Grouped . I've defined the number of Sections as well as the number of Rows for each section. I've set the Style of each cell to be Basic . Now, within each cell, I have the default Content view and Label. For the label I have set the Text to Plain , Font to Body and Lines to 0 .

Dynamic Type within Labels of Basic (Static) Cells of UITableViewController - is it possible?

£可爱£侵袭症+ 提交于 2021-02-11 07:26:34
问题 Question is fairly self explanatory and I may be missing something simple. The following is done in Interface Builder. I have created a UITableViewController, I've set the Content to Static Cells and Style to Grouped . I've defined the number of Sections as well as the number of Rows for each section. I've set the Style of each cell to be Basic . Now, within each cell, I have the default Content view and Label. For the label I have set the Text to Plain , Font to Body and Lines to 0 .

UICollectionView inside UITableViewCell how to set the selection to pass data from the current view to another one

情到浓时终转凉″ 提交于 2021-02-11 06:16:12
问题 I have a view controller with a tableview inside it , in the table view i implemented a collection view with horizontal scrolling, the data appears correctly but i want to go to another view controller when i click on the collection view cell passing a string to that view , how can i handle this process . thanks in advance 回答1: You have two choice 1) Implement Collection view delegate & datasource inside view controller. You can do this in tableview's cellForRowAt method like cell