accessoryview

Removing an Accessory View from a UITableViewCell When The Cell is Not Selected and maintaining between reloading views

泄露秘密 提交于 2019-12-08 17:37:28
I have what I believe to be a simple problem, but I can't find a solution to it. I have a static UITableView with two static cells (Light and Dark). When the user selects one of the cells, I'm displaying an accessoryView with a custom image. When the user selects the other cell, I want the first cell to deselect and to remove the custom accessoryView and for that to be provided to the secondCell. I want this to continuously do this depending on which cell the user selects. Of equal importance, I need to make sure the "selected" cell maintains the accessoryView throughout the reloading of this

iOS 13 UITableViewCell custom accessoryView goes out of bounds

别等时光非礼了梦想. 提交于 2019-12-07 15:38:05
问题 Working with the latest iOS 13 beta I really don't understand if it's beta issues or my issue, but I don't have this problem with iOS 12 code let button = UIButton(type: .custom) button.setTitle("connect", for: .normal) button.backgroundColor = UIColor(rgb: 0xFF0E83) button.sizeToFit() cell.accessoryView = button cell.textLabel?.text = "Title" cell.detailTextLabel?.text = "Subtitle" with result Did someone had the same issue and found a solution? Thanks 回答1: If you put the uibutton in a

How can you create an accessoryInputView in a Storyboard design?

走远了吗. 提交于 2019-12-05 23:23:56
问题 I am trying to create an accessoryInputView to augment the keyboard with some app-specific keys. I am using a Storyboard based design approach to keep the the UI separated from the application logic. I cannot seem to understand how to create the new view and associated it with the textView. Is it possible? 回答1: You can check this sample project from Apple: https://developer.apple.com/library/ios/samplecode/KeyboardAccessory/Introduction/Intro.html To achieve the same result that in the sample

iOS 13 UITableViewCell custom accessoryView goes out of bounds

我们两清 提交于 2019-12-05 18:23:19
Working with the latest iOS 13 beta I really don't understand if it's beta issues or my issue, but I don't have this problem with iOS 12 code let button = UIButton(type: .custom) button.setTitle("connect", for: .normal) button.backgroundColor = UIColor(rgb: 0xFF0E83) button.sizeToFit() cell.accessoryView = button cell.textLabel?.text = "Title" cell.detailTextLabel?.text = "Subtitle" with result Did someone had the same issue and found a solution? Thanks If you put the uibutton in a uiview it will work on iOS 13.0. I am using UILabel instead of UIButton, and same issue occurred with iOS13.1.

UITableCell AccessoryView: Setting accessoryView equal to UIImageView infinite loop

半腔热情 提交于 2019-12-03 00:25:27
问题 EDIT: I have figured out the answer on my own but here it is for anyone else who needs it: UIImageViews cannot be shared so a different instantiation of each UIImageView is required for each visible cell. Now you know. I have a custom table that has 2 types of cells. One cell is just set to toggle between a normal accessory of type checkmark. Another cell is set to have a custom image as the accessory type. When selected that accessory image changes to its opposite type, showing an "Invited"

Can't move keyboard view iOS9 swift

和自甴很熟 提交于 2019-12-01 20:52:17
问题 I need to implement a dismissive keyboard (swiping down to dismiss) like the one in the stock messages app on iOS. I have this code to get the keyboard view: func keyboardWillShowWithNotification(notification:NSNotification) { let keyboardView = accessoryView.superview } And I connected the UIPanGestureRecognizer of the tableView to detect when I need to start moving the keyboard down. func handleTableViewPan(gr:UIPanGestureRecognizer) { let location = panGestureRecognizer.locationInView(self

Can't move keyboard view iOS9 swift

≡放荡痞女 提交于 2019-12-01 20:51:09
I need to implement a dismissive keyboard (swiping down to dismiss) like the one in the stock messages app on iOS. I have this code to get the keyboard view: func keyboardWillShowWithNotification(notification:NSNotification) { let keyboardView = accessoryView.superview } And I connected the UIPanGestureRecognizer of the tableView to detect when I need to start moving the keyboard down. func handleTableViewPan(gr:UIPanGestureRecognizer) { let location = panGestureRecognizer.locationInView(self.view) let offset = ... //calculated correctly keyboardView.frame.origin.y = originalKeyboardFrame

UITableViewCell(s) with default image overwritten with other images upon scrolling

两盒软妹~` 提交于 2019-11-29 15:48:21
Oops,I am facing an issue with table view cells having no image,i.e. the cell with default image.Upon scrolling the default image disappears and some image from a cell is appearing on it.I have implemented the suggestion from Mr.Rckoenes here .Even then I was unable to fix the issue.Here is my implementation code for understanding: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ReminderClass *reminderToDisplay = [self.remindersArray objectAtIndex:indexPath.row]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier

add a view on top of the keyboard using InputAccessoryView swift

≡放荡痞女 提交于 2019-11-28 21:15:14
I'm trying to add a uiview to be on top of the keyboard always. I did it first with KeyboardWillShow/Hide, but it dosen't cover all cases and I'm trying to use inputAccesoryView. this is what I tried: private var accessoryView = UIView(frame: CGRectZero) class ViewController : UIViewController { var myView: customUIView override var inputAccessoryView: UIView { return accessoryView } override func canBecomeFirstResponder() -> Bool { return true } override func viewDidLoad() { super.viewDidLoad() accessoryView = myView } } I get the following error : Terminating app due to uncaught exception

Altering the background color of cell.accessoryView and cell.editingAccessoryView

余生颓废 提交于 2019-11-28 21:12:13
Whenever I add an accessoryView to my UITableViewCell, it doesn't carry the background color across? I'm setting a UISwitch as my accessoryView, and the color I have set in the cell.backgroundColor property only effects the contentView and not the accessoryView. I have tried everything to set them to the same value. I tried to set the cell.backgroundView.backgroundColor and the cell.accessoryView.backgroundColor properties to the color I want but nothing is working. I also tried creating a subview inside contentView, which solved the backgroundColor problem (by avoiding it), but it creates the