accessoryview

add a view on top of the keyboard using InputAccessoryView swift

青春壹個敷衍的年華 提交于 2019-12-29 03:35:07
问题 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

iOS UITest : How to find UITableViewCell's AccessoryView?

核能气质少年 提交于 2019-12-23 12:49:13
问题 Hello I'm learning UITests now I have a question how can detect accessoryView's tap on the tableViewCell ?? in UITest below is my tableViewCell I want detect detail closure accesorry view's tap like this app.tables.cells.buttons["FTCellAccesoryIdentifier"].tap() but accesorry is a subclass of UIView so i allocate accisibility identifier key in cellForRows function cell.accessoryView?.accessibilityIdentifier ="FTCellAccesoryIdentifier" and my test function is i try app.tables.cells

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

人走茶凉 提交于 2019-12-23 03:21:20
问题 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

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

末鹿安然 提交于 2019-12-23 03:21:16
问题 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

Put a UITextField inside a UITableViewCell's AccessoryView

ⅰ亾dé卋堺 提交于 2019-12-13 02:07:51
问题 I am experimenting with putting a UITextField inside a UITableViewCell . Now I got two working methods. Using addSubview method: UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"textFieldCell"]; UITextField *textFieldView = [[UITextField alloc] initWithFrame:CGRectMake(150, 7, 150, 30)]; [textFieldView setPlaceholder:@"Placeholder"]; [cell addSubview:textFieldView]; Using setAccessoryView method: UITableViewCell *cell = [

Get the frame of UITableViewCellAccessoryDetailButton (which is nil)

丶灬走出姿态 提交于 2019-12-12 01:54:05
问题 I was trying to present a popover from a UITableViewCell 's accessoryView. The view is the default UITableViewCellAccessoryDetailButton . Apparently the accessoryView is nil , and, according to this question, this is an intended behavior. My question is, how do I get the frame of the accessory, even though the accessoryView property is nil? 回答1: You don't need to get the frame to present the popover. When you have an accessory view, the width of the cell's contentView is made narrower so it

Get frame for UITableViewCellAccessoryType

ぐ巨炮叔叔 提交于 2019-12-11 13:56:18
问题 I want to present a popover. Currently I can retrieve the frame of the whole cell (as described here). Is it possible to get the frame of the accessory ( UITableViewCellAccessoryType )? I want to retrieve the value in accessoryButtonTappedForRowWithIndexPath or didSelectRowAtIndexPath . 回答1: in didSelectRowAtIndexPath UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; CGRect accessoryRect = cell.accessoryView.frame; 回答2: The best I can come up with is to calculate the frame

UISwitch in Table Cell — determine selected indexPath

血红的双手。 提交于 2019-12-10 18:10:01
问题 I'm using a UISwitch in the accessoryView of a UITableViewCell. The switch uses target-action to communicate when it has been selected or deselected: switchV.addTarget(self, action: "onChangeSwitch:", forControlEvents: UIControlEvents.ValueChanged) The problem is figuring out which switch was selected. I know of 3 methods. Each is unsatisfying somewhow. 1. I can use tags: switchV.tag = indexPath.row But this sucks if you have sections (and I do), because I need to parse it into and out of a

How to add label text to DetailDisclosureButton?

依然范特西╮ 提交于 2019-12-10 12:49:06
问题 I'm working in a iOS Swift 2.0 application. I can't figure out for the life of me on how to set the text on the right side of a UITableViewCell just before the disclosure indicator chevron (besides creating a custom cell.accessoryView ). Here is a screenshot of the "Settings app" doing exactly what I'm trying to achieve. 回答1: In Interface Builder, when setting up your cell, select the Right Detail style: Then assign the value to the detailTextLabel property: cell.detailTextLabel.text =