I am seeing a small (but really annoying) difference between iOS 7 and 8 concerning UIActionSheet. In iOS 7, the button that the user taps in the action sheet is selected immediately, giving prompt visual feedback of which button was pressed. (By "selected" I mean the background color of the button changes.) However, in iOS 8 the button does not visually appear selected unless the user taps and holds an action sheet button. Since a normal tap is typically very brief (and not held), this has the effect of the button usually never looking selected in an iOS 8 action sheet.
What the user sees after tapping Option 2 in iOS 8: no selected button as the dialog does its close animation.
If the user taps and holds Option 2, the button finally appears selected. This is also what the user would see immediately after tapping in iOS 7.
UIActionSheet usage:
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:#"Option 1...", #"Option 2", #"Option 3", #"Option 4",
nil];
[actionSheet showFromBarButtonItem: myView.optionsButton animated: YES];
Please note that the action sheet otherwise functions as expected. The appropriate action call is made, etc. The issue is only the lack of visual feedback of the button press.
I know that UIActionSheet is deprecated in iOS 8, however, I have tried using UIAlertController with the same results. This seems to be an OS-wide user interface decision.
In iOS 7, there is immediate visual feedback when tapping an option in an action sheet. Is there anyway to get this behavior back in iOS 8?
Edit: The action sheet button in Mail in iOS 8 demonstrates the behavior. This is the Reply/Forward/Print button. Tapping an option does not give visual feedback, but tapping and holding the option does.
Related
I'm currently working on a Xamarin MvvmCross ios app. I have it set to display a UIAlertView popup to inform the user when their internet is disabled (the app requires an internet connection).
The problem is that when this popup shows, the user can't swipe up the Control Center to activate their internet...
var dlg = new UIAlertView(config.Title ?? String.Empty, config.Message, null, config.CancelText, config.OkText);
dlg.Clicked += (s, e) =>
{
var ok = (dlg.CancelButtonIndex != e.ButtonIndex);
_activeDialog.DismissAlertDialog();
config.OnConfirm(ok);
};
dlg.Show();
They then have to either click OK and race the popup reappearing, or home the app, reactivate internet, then come back to the app...
Anyone any suggestions?
It's not possible to get around this, since UIAlertView is probably being displayed above the window that handles gestures for the Control Center. This is the way Apple made it.
I would use a custom view as a UIAlertView and fade the background view's alpha. Or you could use a library that already does this:
https://github.com/alexanderjarvis/PXAlertView
https://github.com/wimagguc/ios-custom-alertview
https://github.com/ChrisXu1221/CXAlertView
Related Questions:
Can't use Control Center when UIAlertView displayed (iOS 7)
UIAlertView Strange Behaviour with Shortcut Control center
I am stuck on Accessing uialertview buttons in ios 7 . when googling i read ios 7 did not allow to customize or chenging the uialert view button .
I want to do these functionality in my project my deployment target is 5.0-
->I want to disable AlertView first button disable for 15 second with its title like this
OK(15),OK(14)......OK(0),OK(with user enable). After completion 15 seconds user can tap to the ok button to dismiss the alert view .
please suggest me how to do this.
Can i get the ok (fist button) of alert view and can change its title as i write above .
Or
i have to use custom alert view .
I want to show the default looking UIAlert which match with IOS 7 and earlier version Ui
Thanks .
I'm relatively new to iOS 7 and Objective-C programming, and I'm working on an app project, and when the app opens, I'd like to prompt the user for their name so I can then use that name to populate a label on the main screen in a single-view application.
It seems like this would be easy to do, but I've been searching various combinations of terms here on Stack Overflow and elsewhere on the web, and I've not been able to find an answer that works in this context, and the Apple docs can be pretty opaque to a novice user.
I've learned how to use UIAlertView to present a dialog with a text entry field using UIAlertViewStylePlainTextInput, so I am able to get information from the user. However, the alert dialog is not modal, so program execution continues in the background. As a result, by the time I fetch the user info, the view has already been populated with a blank value where I want the name to go.
It's very possible UIAlertView may not be the right way to do this, so I am hoping someone can suggest a good way to do this. The code I currently have is this:
UIAlertView *nameRequest = [[UIAlertView alloc] initWithTitle:#"Hello!" message:#"What is your name?" delegate:nil cancelButtonTitle:#"Let's Go!" otherButtonTitles: nil];
[nameRequest setAlertViewStyle:UIAlertViewStylePlainTextInput];
[nameRequest show];
UITextField *name = [nameRequest textFieldAtIndex:0];
The "standard" way to do this would be to use two view controllers. The first one should have a UITextField and a button. User enters their name in to the textfield and presses the button. Then they are taken to the second view controller that displays their name.
Why don't you draw another view on your existing view by using addsubview
After the data you want is collected, you can remove the other view from the existing view using removefromsuperview.
My app allows the user to link other people within the app to entries in the contact book, and if one doesn't exist add a new one. I accomplish this by presenting an ABPeoplePickerNavigationController with an added button on the top for "Add Contact" which pushes an ABNewPersonViewController.
The problem I have is this functionality works perfectly in iOS 6, but completely fails to work properly in iOS 7. Clicking the "Done" button does absolutely nothing, and clicking "Cancel" simply stops the fields from being editable.
Has anyone encountered something like this and know how to fix it? Is this a known issue (Google search returned nothing useful"
Same problem for me.
My code was as follows,
ABNewPersonViewController *npvc = [[ABNewPersonViewController alloc] init];
npvc.view.backgroundColor = [UIColor colorWithRed:0.188 green:0.545 blue:0.016 alpha:1.0];
After I removed “npvc.view.backgroundColor =…”, it works fine.
Probably the structure of ABNewPersonViewController underneath has changed, so we are not allowed to set its background color.
I have a problem with the app I'm working on. This image will explain what.
As you can see, the "low battery notification prompt" appears under the date picker. This also happens when I have an action sheet active on display in my app and then a "new message prompt" appears when somebody texted me. In my code i called the action sheet to display in view.
[self.view addSubview:datePickerView];//Where I add date picker
[actionSheet showFromTabBar:self.tabBarController.tabBar];//Where I add the action sheet
In action sheet I also tried
[actionSheet showInView:self.view];
I don't have an idea how to fix this since Im new in iOS. I hope one can help.
Thanks!