I'm using Xamarin Forms picker Control, When the control shows up on Android Device, it has 2 buttons on it the "OK" and "Cancel", on IOS however i Get only the "Done" button, it causes the user to be unable to perform cancel operation to discard its new selection and forces him to scroll back to the original selection, is there is a way to have this button? or some workaround for it?
No, and it's unfortunate because there's nothing inherent to iOS itself that prevents it. In fact many applications allow you to cancel your pick selection.
It's just one of those Xamarin quirks.
You can use
iOSSpecific:Picker.UpdateMode="WhenFinished"
so that the picker value only gets set when the user presses the Done button - Not quite what you asked but as an alternative its not too bad.
You need this name space
xmlns:iOSSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
and use in your picker like this
<Picker ItemsSource="{Binding Options}"
SelectedItem="{Binding Result}"
ItemDisplayBinding="{Binding Label}"
iOSSpecific:Picker.UpdateMode="WhenFinished" />
Related
When I use just plain ActionBar:
<ActionBar/>
when I changing route with:
this.$navigateTo(Catalog)
the native ios Back button appears normally,
but when I change action-bar like this:
<ActionBar title="some title"/>
or put other elements inside action-bar like this:
<ActionBar>
<NavigationButton text="Go back" android.systemIcon="ic_menu_back" #tap="goBack" />
<ActionBar/>
the default native ios Back button disappearing.
What I need in the end is default ios action-bar with custom title and native ios back button that appears when I navigate between components. Please help, thanks in advance!
Solved my problem. I was using ActionBar in my main component(where tabs where defined). Instead, I removed it from my main component and added its own ActionBar for every component. That solved the problem. Now the default ios back-button displaying properly with any other combinations of params or nested elements and it doesn't matter wether you route to frame of same component or not.
I'm unable to reproduce the issue on my end, the NavigationButton is still visible when I use the exact code snippet above, tested with iOS v12.1.4. Please share the Playground sample if you still have the issue on your end.
However, you will not be able to modify the tap handler on iOS as mentioned in the docs.
In iOS, the back button is used explicitly for navigation. It
navigates to the previous page and you cannot handle the tap event to
override this behavior.
If you want to place a button on the left side of the ActionBar and
handle the tap event (e.g., show slide-out), you can use ActionItem
with ios.position="left".
I want to know the event in blocks section using which the entered text value can be obtained without a form submission through button.
Let's say user inputs text in mobile phone through keyboard and presses enter. In this case I want some event to trigger and get the value that user entered.
There are 2 events available like lostfocus and gotfocus.
Will these work? Or is there any other good approach for getting text value on pressing enter?
Unfortunately there is no such event like OnEnterPressed available in MIT App Inventor and the events LostFocus and GotFocus will not work in this case.
What you currently can do is
use a button and use the Button.Click event, or
create your own custom keyboard, see also this example
Currently there is a limitation for App Inventor extensions, which only can be used for non-visible components. Later as soon as also visible components are doable, then you could write your own textbox extension and add an event yourself.
Edit concerning the new question in the comments about different screens:
Use different screens wisely
Before starting to create another screen, first you should think about is it really necessary? See also Building apps with many screens and SteveJG's post about advantages/disadvantages, because in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed...
You can insert a Clock component that monitors the TextBox1.Text. When it triggers, it checks if the TextBox1.Text has changed and saves it to a variable. When it triggers again, it compares the variable with TextBox1.Text. After the user finishes typing, the variable and TextBox1.Text will be equal and then you can trigger the event like you eanted when the user pressed Enter.
Hope this helps!
I have a Xamarin.Forms application with a login screen. I have added code to move the controls out of the way, when one of the Entry fields gets focus. I move the views back down in the Unfocus event handlers. In the simulator I can prevent the software keyboard from popping up. Unfortunately my event handlers still move the view up and down even without the keyboard.
Is there a way to detect the keyboard's appearance in Xamarin.Forms, while in the event handlers on the ContentPage?
I don't think there is support for this out of the box and thus I'd go with DependencyService and implement it by myself.
You could use ContentPage.LayoutChanged event.
It works because the keyboard doesn't display over the content page as one would guess, but under it, in the same layer, so it push the page up.
I am New to Phonegap Development, I am Using jQuery mobile to create my UI. I have two Issues here,
Response of button for touch event is very slow. Why..?
I have Created a form with some elements like 2 Inputs text type, 2 Button one after another.
M problem is when I click on input, the keyboard popup makes the page move up, that's OK but when I press the keyboard resign button, the page stay little up.
Can you please help me out..!
and how to Optimize the responsiveness of JQuery mobile UI. I have completely avoided the images.
First, you can follow this link to remove the delay (300ms) from the click event.
And for the second one, i hope you are facing this issue for android. if so, then you need some changes to be done on the AndroidManifest.xml
Use below android property in application tag,
android:hardwareAccelerated="false"
android:windowSoftInputMode="adjustPan"
Will look something like
<application android:icon="#drawable/icon" android:label="#string/app_name"
android:hardwareAccelerated="false"
android:windowSoftInputMode="adjustPan">
This should resolve your issue.
In my iOS app's Settings screen, there is one setting which is quite fundamental. I wish to inform users about this with a UIAlertView.
Preferably I would display this when the back button is pressed (and thus they are finished editing their settings). However, is this possible, or even allowed by Apple? If so, how?
My second choice would be to show the UIAlertView as soon as the setting is changed, but if this is possible its not really a preference. And if it is possible, how do I do it?
Edit - 2nd August 2012 : My app has its own Settings screen in addition to the built in Settings screen, so my question applies to both screens. Also, note that the setting is a UISwitch.
Also, I preferably would like a cancel button on the UIAlertView that allows the user to NOT leave the settings screen once they have read the warning. Is this possible?
You cannot do it for the iOS Settings app, but in your own app's settings view controller you could show an alert on viewWillDisappear:
UPDATE: From the comments, you want to override the back button behaviour. I would suggest that you hide the back bar button item and create your own button. Then if the user accepts in the prompt, you call [self popViewControllerAnimated:YES];
As of yet I do not believe my aim is possible on the traditional settings screen.
On my own settings screen, a UIAlertView is possible when the back button is pressed. The solution can be found here. However, it breaks the parts of my app which automatically pop screens without the user pressing the back button.
I therefore simply have made a UIAlertView pop up when the setting itself is changed. I haven't included a 'cancel' button on the pop up.
Further alternative answers here on Stack Overflow, however, will be welcome!