uitableview

How to populate a UITableViewCell with the correct resolution image?

怎甘沉沦 提交于 2020-01-14 13:37:28
问题 I have set up a UITableView that contain cells of images. I am using Asset Catalog to name the images appropriately as image1.png, image1@2x.png, and image1@3x.png. I have an NSMutableArray that I initialize with the image names from Asset Catalog, for example like so: viewDidLoad: self.LogoArray = [ [NSMutableArray alloc] initWithObjects:@"image1",@"image2", image2", nil]; Then I created a Custom Cell with my own custom image to display in the cell: - (UITableViewCell *)tableView:

Prevent subview from scrolling in a UIScrollView

戏子无情 提交于 2020-01-14 12:40:14
问题 I have a UIScrollView subclass with a certain subview I'd like to prevent from scrolling (while all the other subviews scroll as normal). The closest example to this I can think of is UITableView 's "index strip" on the right side (look in the Contacts app to see an example). I am guessing this is a subview of the table (scrollview) but it does not move as the user scrolls. I can't seem to make my subview stay put! How can I accomplish this? 回答1: The trick is to adjust the frame of the "non

How to get UITableView Label Text string - Custom Cell

北战南征 提交于 2020-01-14 11:46:07
问题 I have a UITableView with CustomCell. The custom cells contain a UILabel and a UIImageView. I saw online that it is possible to get the text from a normal UITableView cell and store it in a string when the user presses the cell. But how can you do this when you are using a custom cell? Becuase the name of my UILabel is "type_label" and it has been defined in the header file of my CustomCell XIB. So in Xcode I can't use: cell.type_label.text" In the following function: -(void)tableView:

UITextField inside UITableViewCell - method for preventing text reset

╄→尐↘猪︶ㄣ 提交于 2020-01-14 11:34:10
问题 I have a UITableView tall enough that it necessitates scrolling. The top-most cell in the table contains a UITextField for the user to enter some text. The standard way to build this might be to create and add the text field and add it to a cell created or recycled in cellFOrRowAtIndexPath: However, this constant re-creation means that the text entered in the field is erased when the cell is scrolled out and back into view. The solutions I've found so far suggest using UITextField delegation

UITextField inside UITableViewCell - method for preventing text reset

强颜欢笑 提交于 2020-01-14 11:33:19
问题 I have a UITableView tall enough that it necessitates scrolling. The top-most cell in the table contains a UITextField for the user to enter some text. The standard way to build this might be to create and add the text field and add it to a cell created or recycled in cellFOrRowAtIndexPath: However, this constant re-creation means that the text entered in the field is erased when the cell is scrolled out and back into view. The solutions I've found so far suggest using UITextField delegation

Static UITableViewCell blank - Swift, iOS 8

余生颓废 提交于 2020-01-14 10:23:20
问题 I am trying to implement some static cells in a UITableView using Xcode 6 beta 2 and Swift. I have successfully implemented dynamic cells. When the user clicks on one of the dynamic cells there is a push segue to a new UITableViewController for a UITableView with static cells. I have set this all up in Xcode and the segue works but when I drag a UILabel onto one of the static cells it just doesn't show up at run time. A few things that might help narrow down whats going on: The data source

UITableView Edit Mode Show Custom Buttons

此生再无相见时 提交于 2020-01-14 09:05:16
问题 I know that people hate vague questions here so I just need a yes or no answer. I have a tableView and I want people to be able to edit the contents of the table. I like the setEditing method but I don't want the button to say Delete - I would prefer Remove and there are times where I want to display more than one button and hide the delete button. I just need to know if this is possible. I am ready to give up on using the standard edit and delete buttons and just make my own but before I did

UITableView with custom cells not entering editing mode

隐身守侯 提交于 2020-01-14 08:55:09
问题 I have a UITableView with custom UITableViewCells. The table has two sections, the first section has a single row with a UITextField and can only be edited in terms of the text. This section & row cannot be edited from a UITableView perspective The second section is a list of cells that are generated from an NSArray. These cells are once again custom UITableViewCells comprising of two UITextFields. These cells can be edited from a UITableView perspective, in the sense that the user can delete

My UISearchBar moves to top (animated) --> want to disable

故事扮演 提交于 2020-01-14 08:05:29
问题 I want implement an UISearchBar on my tableView . My code (in viewDidLoad) : self.searchController = UISearchController(searchResultsController: nil) self.searchController.searchResultsUpdater = self self.searchController.delegate = self self.searchController.searchBar.delegate = self self.searchController.searchBar.autocapitalizationType = .None self.searchController.searchBar.autocorrectionType = .No self.searchController.hidesNavigationBarDuringPresentation = false self.searchController

My UISearchBar moves to top (animated) --> want to disable

雨燕双飞 提交于 2020-01-14 08:03:48
问题 I want implement an UISearchBar on my tableView . My code (in viewDidLoad) : self.searchController = UISearchController(searchResultsController: nil) self.searchController.searchResultsUpdater = self self.searchController.delegate = self self.searchController.searchBar.delegate = self self.searchController.searchBar.autocapitalizationType = .None self.searchController.searchBar.autocorrectionType = .No self.searchController.hidesNavigationBarDuringPresentation = false self.searchController