uitableview

Swift - Fading cells in UITableView

拥有回忆 提交于 2020-01-12 02:02:13
问题 I'm having troubles with my UITableView in swift on Xcode 6 : I would like my UITableView cells to fade in / out when appearing / disappearing. I looked a lot on the web for fade animations but I didn't find what I wanted because it's based on duration animations. I Think what I need is sort of mask based on alpha ? I'm not sur and I don't even know have to create one... I have a UIViewController containing a tableView and some blank space (for now) upside and downside of the UITableView.

How do I create a multiline table cell in iOS?

橙三吉。 提交于 2020-01-11 19:56:25
问题 How can I get the second cell to expand to fit the text rather than scaling the text? Is there a built in way of doing this in iOS or will I have to come up with some home-cooked solution? If you look in the iOS Contacts application, there's a box like this for Address. I can't find how to implement this though. For anyone looking to achieve this in future, here's the code for my solution: HEADER file: #define FONT_SIZE 22.0f #define CELL_CONTENT_WIDTH 320.0f #define CELL_CONTENT_MARGIN 5.0f

How do I create a multiline table cell in iOS?

流过昼夜 提交于 2020-01-11 19:56:13
问题 How can I get the second cell to expand to fit the text rather than scaling the text? Is there a built in way of doing this in iOS or will I have to come up with some home-cooked solution? If you look in the iOS Contacts application, there's a box like this for Address. I can't find how to implement this though. For anyone looking to achieve this in future, here's the code for my solution: HEADER file: #define FONT_SIZE 22.0f #define CELL_CONTENT_WIDTH 320.0f #define CELL_CONTENT_MARGIN 5.0f

How to scroll the header along with the UITableView?

可紊 提交于 2020-01-11 17:52:43
问题 I have a UITableView with a header. the problem I currently have is that the header doesn't scroll with the table. I need it to scroll off screen (above) when the user scrolls the table view up. the tableview scrolls but the header is locked at the top of the UIView . thanks - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *sectionHeader = [[UILabel alloc] initWithFrame:CGRectNull]; sectionHeader.backgroundColor = [UIColor whiteColor]; // add

How to scroll the header along with the UITableView?

左心房为你撑大大i 提交于 2020-01-11 17:46:35
问题 I have a UITableView with a header. the problem I currently have is that the header doesn't scroll with the table. I need it to scroll off screen (above) when the user scrolls the table view up. the tableview scrolls but the header is locked at the top of the UIView . thanks - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *sectionHeader = [[UILabel alloc] initWithFrame:CGRectNull]; sectionHeader.backgroundColor = [UIColor whiteColor]; // add

[tableView reloadData]; doesn't work until I scroll the tableView

巧了我就是萌 提交于 2020-01-11 17:39:11
问题 I have a simple app that downloads search results in XML when the user types in a UISearchBar . The download+parsing is threaded and once done it fires an NSNotification to tell the ViewController with the table view to [tableView reloadData]; Here is the code that receives the notification fired once results are in: - (void)receivedResults:(id)notification { results = [notification object]; DLog(@"Received %i results",[results count]); [[self tableView] reloadData]; } I get the log output

UITableView section footer view position after endUpdates

最后都变了- 提交于 2020-01-11 17:08:20
问题 On ios8 I'm using core data table view controller, and after deleting rows my section footer view suddenly goes all the way down to the bottom of the UITableView . When I scroll the table view, footer view goes back to its place. How can fix this and why is this happening? Here is the code just in case. - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:

Adding the little arrow to the right side of a cell in an iPhone TableView Cell

…衆ロ難τιáo~ 提交于 2020-01-11 14:53:42
问题 This should be simple enough. I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell? 回答1: Just set the respective accessoryType property of UITableViewCell . cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; In Swift 3 , cell.accessoryType = .disclosureIndicator 回答2: You can do this in Interface Builder. Simply click click on the Table View , go to Prototype Cells on the right side and make it 1. Then click that

Adding the little arrow to the right side of a cell in an iPhone TableView Cell

佐手、 提交于 2020-01-11 14:53:28
问题 This should be simple enough. I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell? 回答1: Just set the respective accessoryType property of UITableViewCell . cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; In Swift 3 , cell.accessoryType = .disclosureIndicator 回答2: You can do this in Interface Builder. Simply click click on the Table View , go to Prototype Cells on the right side and make it 1. Then click that

How to make a Sub Table view in a TableViewCell

邮差的信 提交于 2020-01-11 14:14:04
问题 I have a TableView displaying a list of domain : - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.tableView.dataSource = mainClass.domainList; } The domain list is set up like that : -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.domainList count]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [