Open markddaa opened 9 years ago
+1, in a swift project it is enough to just add the pod to the project, you do not even have to do number 5.
A work-around:
collection-view collection-view-cell > view{ width: 270px; }
works on alert textfield but also affects on collection view cell.....
Yeah, skipped this workaround myself, since it conflicted with uiactivityviewcontroller, and rewrote the app to not contain any alerts with input fields. I guess Pixate Freestyle is kind of dead...
one more workaround
var list = alertController.view.subviews as! [UIView] for _ in 0 ..< 7 { list = list.flatMap { (view) in return view.subviews as! [UIView] } }
for view in list {
if view is UICollectionView {
view.styleClass = "fix_text_field_in_alert_view"
}
}
where .fix_text_field_in_alert_view collection-view-cell > view { width: 270px; }
@Pitsko that works! thx so much for the provided workaround. Hopefully Pixate will update their product to support iOS 9 soon
what I did:
what I got:
the textfield size is incorrect
===============source code=============
(void)showAlert { // use UIAlertController UIAlertController *alert= [UIAlertController alertControllerWithTitle:@"Enter Folder Name" message:@"Keep it short and sweet" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action){ //Do Some action here UITextField *textField = alert.textFields[0]; NSLog(@"text was %@", textField.text);
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[alert addAction:ok]; [alert addAction:cancel];
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = @"folder name"; textField.keyboardType = UIKeyboardTypeDefault; }];
[self presentViewController:alert animated:YES completion:nil];
}