uitableview

How to increase the label and cell size on clicking a button in a TableViewCell.

雨燕双飞 提交于 2020-01-12 15:58:27
问题 I want to expand the cell size after clicking a seeMoreBtn on cell. The label and cells have varying length, but their is a constraint in size of label. When a status is too big, I added a seeMoreBtn, after clicking on see more the remaining text will be shown below, then how to increase the label and cell size. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; { NSString *text = [items objectAtIndex:[indexPath row]]; CGSize constraint =

custom tableviewCells for UITableView created programatically in storyboard [closed]

你。 提交于 2020-01-12 14:23:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . In my app I am using storyboard. But I created a UITableView programmatically instead of dragging from Object Library. And now I want

UITableView scrollToRow no longer works on iOS 11 right after adding a new row

我的未来我决定 提交于 2020-01-12 14:13:30
问题 I've noticed a weird UITableView behaviour which only seems to occur on iOS 11 devices. Right after inserting a new row (changing data source and then calling reloadData, UITableView won't scroll to that row when calling scrollToRow or scrollToBottom() method. When doing the some thing on iOS 10 or earlier version, it works perfectly and UITable scrolls like it's supposed to. Thanks! 回答1: dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(

Swift - UITableView scroll event

萝らか妹 提交于 2020-01-12 12:54:28
问题 I was wondering how to detect if the UITableView is scrolled (up or down). I want to hide the keyboard when the UITableView is scrolled with self.view.endEditing(true) . Thanks in advance 回答1: You can add UIScrollViewDelegate . After that you can implement scrollViewDidScroll method. 回答2: You can set property of UITable view (XCode 7+) In Storyboard: in Code: tableView.keyboardDismissMode = .onDrag 回答3: I believe the complete solution would be the following: func scrollViewDidScroll(_

Populate UITableView Sections table with Single NSMutableArray

蹲街弑〆低调 提交于 2020-01-12 10:46:38
问题 Sorry to ask again the question with full description.What i have that i have resultsArray which has title description etc which gets from server but problem is that i want to show this data in sections. So lets say if have three sections which are coming from array then how will populate the data in each section using single resultArray. - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [categoryArray objectAtIndex:section]; } resutArray has

How do select a row from each section of the tableview in swift?

坚强是说给别人听的谎言 提交于 2020-01-12 09:48:50
问题 I want to select a row from different sections of the same table-view. I am getting output that many rows are selecting but I want exactly only one selected row from each section. Here is My Arrays: var filterFeedUnderAll = ["Complex","NotComplex","Easy"] var filterFeedUnderAllStocks = ["AllStocks","Portfolio","Watchlist","Sector","Ticker"] var filterFeedUnderByDate = ["ByDate","ByComments","ByLikes"] The methods I have used: func numberOfSectionsInTableView(tableView: UITableView) -> Int {

When I use Auto Layout to choose each cell's height (so they're dynamic) it mostly works, but some cells are a little short. Why is this?

拜拜、爱过 提交于 2020-01-12 09:21:30
问题 Example project: http://cl.ly/2j0A1J203f3h I'm trying to use Auto Layout to dynamically determine each cell's height so some cell's can hold more content than others. To do this I'm using this Stackoverflow answer and the accompanying GitHub example. I have a UITableViewCell subclass called CSPostCell that I created in the Storyboard and put a UILabel in with a maximum of 5 lines of text in the label. Just for example purposes, I'm only having two cells in the table and as such two different

When I use Auto Layout to choose each cell's height (so they're dynamic) it mostly works, but some cells are a little short. Why is this?

人盡茶涼 提交于 2020-01-12 09:21:25
问题 Example project: http://cl.ly/2j0A1J203f3h I'm trying to use Auto Layout to dynamically determine each cell's height so some cell's can hold more content than others. To do this I'm using this Stackoverflow answer and the accompanying GitHub example. I have a UITableViewCell subclass called CSPostCell that I created in the Storyboard and put a UILabel in with a maximum of 5 lines of text in the label. Just for example purposes, I'm only having two cells in the table and as such two different

UITableView tableFooterView weird resizing

≡放荡痞女 提交于 2020-01-12 08:22:09
问题 I want to display a UIButton in a UITableView's Footer (should be exactly the same for the header). This code is in the viewDidLoad of my TableViewController: UIButton *footerShareButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [footerShareButton setFrame:CGRectMake(10, 0, 70, 50)]; NSLog(@"%f", footerShareButton.frame.size.width); [self.tableView setTableFooterView:footerShareButton]; NSLog(@"%f", footerShareButton.frame.size.width); NSLog(@"%f", self.tableView.tableFooterView

Editable UITableView with a textfield on each cell

ε祈祈猫儿з 提交于 2020-01-12 08:14:29
问题 I am new to the iOS world and I want to know how to make a UITableView with custom cells that look and behave like the one you have when you try to configure some WiFi connexion on your device. (You know the UITableView with cells containing UITextField s with blue font where you set up the ip address and all that stuff... ). 回答1: To make a custom cell layout do involve a bit of coding, so I hope that dosen't frighten you. First thing is creating a new UITableViewCell subclass. Let's call it