dismiss

How to dismiss AlertDialog in android

青春壹個敷衍的年華 提交于 2019-12-27 23:37:00
问题 I created AlertDialog that contains 4 buttons OptionDialog = new AlertDialog.Builder(this); OptionDialog.setTitle("Options"); LayoutInflater li = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = li.inflate(R.layout.options, null, false); background = (Button) v.findViewById(R.id.bkgSpinnerLabel); SoundVib = (Button) v.findViewById(R.id.SoundVibSpinnerLabel); OptionDialog.setView(v); OptionDialog.setCancelable(true); OptionDialog.setNeutralButton("Ok", new

How to dismiss AlertDialog in android

感情迁移 提交于 2019-12-27 23:36:38
问题 I created AlertDialog that contains 4 buttons OptionDialog = new AlertDialog.Builder(this); OptionDialog.setTitle("Options"); LayoutInflater li = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = li.inflate(R.layout.options, null, false); background = (Button) v.findViewById(R.id.bkgSpinnerLabel); SoundVib = (Button) v.findViewById(R.id.SoundVibSpinnerLabel); OptionDialog.setView(v); OptionDialog.setCancelable(true); OptionDialog.setNeutralButton("Ok", new

Dismissable alert

天涯浪子 提交于 2019-12-25 14:41:57
问题 I'm trying to get an alert to disappear when the "x" button is clicked, but there seems to be something missing that's keeping it from working, not sure what it is. <div class="alert alert-success alert-dismissible"> <button type = "button" class="close" data-dismiss = "alert">x</button> You've done it! </div> 回答1: for dismissible to work, you need to include jQuery and bootstrap.js in your document. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA

Can not dismiss an action sheet here

时光毁灭记忆、已成空白 提交于 2019-12-25 12:45:09
问题 A UILongPressGestureRecognizer is added to my imageView with action handleLongPressOnPhotos. The most related codes is as following: - (IBAction)handleLongPressOnPhotos:(UILongPressGestureRecognizer *)sender { self.imageWillBeSaved = (UIImageView *)sender.view; //breakPoint1 UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Save the photo" otherButtonTitles: @"Go to the Original photo", nil]; actionSheet

How to use dismissDropDown() in simpleadapter listview in android?

青春壹個敷衍的年華 提交于 2019-12-25 04:26:09
问题 I am building an android application where I am using AutoComplete text to show the search of google place name. Now the problem is I want to dismiss the list when I selected any item from the listview. Here is my code - !. oncreateview - atvPlaces = (AutoCompleteTextView) findViewById(R.id.atv_places); atvPlaces.setThreshold(1); atvPlaces.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { placesTask = new

Keyboard dismisses after multiple UIAlertViews are opened

故事扮演 提交于 2019-12-24 12:20:02
问题 I am having a weird issue with my keyboard automatically closing and then reopening when I open multiple UIAlertViews. If I have a keyboard (from a separate UITextField) and I display a UIAlertView, then upon dismissal of that alert I open another (opening the second one in the didDismissWithButtonIndex). When I dismiss the 2nd one it dismisses the keyboard which then comes back up. If i try this with more than 2 alerts in a row, it will still close my keyboard after the 2nd alert is

Dismiss keyboard through return key with swift

北城以北 提交于 2019-12-23 13:08:23
问题 I am a beginner programmer working with Swift. I have been working on a to-do list application. I am trying to dismiss a keyboard through the return key. I have tried the 'self.view.endEditing(true)' and the 'resignFirstResponder()' methods, but neither of them are working. Here is my code: (I am using a tab-application) class SecondViewController: UIViewController, UITextFieldDelegate { @IBOutlet var text: UITextField! @IBAction func addItem(sender: AnyObject) { toDoList.append(text.text)

Flash AS3 KeyboardEvent not firing

喜欢而已 提交于 2019-12-23 05:31:27
问题 I have a class like this: public class GameOverScreen extends MovieClip { public function GameOverScreen(useMouseControl:Boolean) { if(useMouseControl){ Mouse.show(); restartButton.addEventListener(MouseEvent.CLICK, onClickRestart); } else{ this.addEventListener(KeyboardEvent.KEY_DOWN, onPushSpace); } } public function onClickRestart(mouseEvent:MouseEvent):void{ dispatchEvent(new NavigationEvent(NavigationEvent.RESTART)); } public function onPushSpace(keyboardEvent:KeyboardEvent):void{ trace

self.dismiss does nothing on 3rd level segue

为君一笑 提交于 2019-12-23 01:21:26
问题 I have a view controller embedded in a navigation controller. I segue to a view controller via a "show" segue. From there I navigate to a tableviewcontroller via a "show" segue. The navigation bar shows up with the back button but upon didclickrow self.dismiss does nothing. The completion block never executes. I'm baffled. There has to be some rule I don't understand about view controllers. self.dismiss(animated: true, completion: { print( "THIS NEVER EXECUTES AND NOTHING HAPPENS" ) }) 回答1:

Dismiss AlertDialog.Builder from OnClick

本小妞迷上赌 提交于 2019-12-20 12:40:52
问题 I'm trying to make it so that a dialog pops up for users which has two buttons in the body and a cancel button at the bottom. When a user clicks one of the two buttons the dialog will disappear, and hitting cancel will just cancel out of the dialog. The cancel part works fine, but I can't figure out how to dismiss the dialog manually. Here's my code: public void onItemClick(AdapterView<?> parent, View view, final int position, long id) { Context mContext = getApplicationContext();