How to hide a keypad for IOS in Titanium without using 'blur' - titanium

Can anyone please let me know how to hide the keypad without using 'blur' in titanium for IOS.
My scenario is I have a textfield, When I scan an item, that value will be shown on textfield. When textfield is focused, the scanner will be activated. In this scenario i need to focus the textfield, but should not show the keypad.
Can any one please share your ideas.
Thanks,
Swathi.

There is no possibility to hide keypad when textfield is focused on iOS. It is a system thing.
I think your approach is wrong. Why do you need textfield if you don't want to type text there?
Instead of it:
- create label (or label inside view) with proper background (looking like textfield),
- add 'click' event which will start scanning (i suppose you have that functionality for 'focus' event),
- if you need cursor blinking than create animation next to label.

Related

Xamarin Forms: Show an entrybox after tapping an image

I am trying to show an entrybox after tapping an image.
I have this:
And I want to achieve this after tapping on the keyboard image:
The gesture is not a problem I add this lines:
keyboard.GestureRecognizer.Add(new TapGestureRecognizer((view,args) =>
{
ShowEntryBox();
})):
The problem is that I do not know how I can show the entry box, I use XAML. I tried relativelayout and I saw samples of absolutelayout but I can not achieve it.
I am using Xamarin forms to android and ios App.
Perhaps try a Grid?
In the center cell you can create two child controls:-
*) Label control.
*) Entry control.
and then give these controls each a name and set the appropriate .IsVisible value on each of these two controls accordingly, or alternatively hook the IsVisible for each of these controls into a ViewModel and set the state there instead.

Keep textfield above keyboard

I am trying to figure out how to keep the textfield about the keyboard in IOS. I tried the different code on stackoverflow but none works perfectly. Like if the textfield is above the keyboard and I click on the field, it does not move up. How can I show the textfield above the keyboard at all times? thanks!
lakesh's link is an excellent resource to look at.
There are essentially two ways to handle the situation.
Method 1:
You can encapsulate your view inside a UIScrollView and when the keyboard pops up, you should scroll your entire view up an equal distance to account for the space taken up by the keyboard.
Method 2:
Take the ultimate parent UIView inside your current UIViewController and change its frame (ideally with an animation) so that it moves off the top of the screen and makes way for the keyboard.
As a general guide, Method 1 is the preferred method. This is because you can still access the UI 'higher up' in the UIScrollView by scrolling up to it (consider say, a form with multiple fields). In Method 2 the user cannot return to the other elements in the view without the keyboard first being dismissed. Of course, it may be that you don't need to see the rest of the view while accepting keyboard input, but that decision is up to you.

Custom keyboard for a textfield without the standard keyboard

I am trying to write an app that uses a custom keyboard. How can I write code that prevents the iPhone keyboard from popping up. I have seen a custom keyboard that enters text in other iPhone applications, so I know that it is possible.
You're looking for the inputView property that's present on every view (inherited from UIResponder).

iPad UIButtons responding to external keyboard input

I'm writing an app based around a calculator-like UI. On an iPad, I'd like the number UIButtons on my calculator UI to respond to the numbers on the external keyboard. I have no text input anywhere in the app, and I'd never want an on-screen keyboard to appear. How do I get my UIButtons to respond to specific key presses as if they'd been touched?
I'd say create a hidden UITextField with the delegate set, make it become the first responder upon viewDidLoad. The keyboard won't appear when a bluetooth keyboard is connected as far as I know, then just check what characters are typed in the shouldChangecharactersInRange and activate the right buttons accordingly.
EDIT: a quick example I just made, https://github.com/benjaminq42/buttonTest , if you wish to have a highlight animation of some sorts you need to create a custom UIButton class. You can use 'setHighlighted' but that 'sticks'.

adding an invisible button to the background in IB

I'm working with Xcode doing a Ipad app.
i simply want user to click anywhere on screen (not counting text fields) to perform some IBAction.I'm using an invisible button that covers my whole view.
Since I have some text fields in my view,i need to add this invisible button to the background of my user interface. I cant seem to find this option in the button attributes? any help?
Just set the button's type to custom.
Did you try setting the opacity of the button to zero?
I guess i got your point. You just want to put the UIButton(invisible) on the back of all the UITextField. The simple solution to this is open the Document Window in the IB. Now expand the view tree in the list view. Just drag your UIButton above the UITextFields and set the alpha value for the button in the property to be zero.
Hope this helps!!
iPad users don't "click". They "tap" or "touch".
In Interface Builder, I believe views are constructed with a z-index from top to bottom as they appear in the document window, so dragging your button so that it appears as the first subview of your main view should be a quick fix for this.
Have you considered other approaches? This doesn't sound like standard behaviour for an app and will probably cause havoc with anybody using Voice Over. What are you trying to accomplish?