react-native and expo default options language issue - javascript

I am working on a react-native application based on expo.
My problem is that I am trying to find a solution to make the default options on inputs : paste cut select select all...
and the default actions on the camera: take picture... uses the default language of the mobile phone and not all the time English.
is there a way to do this ?

Well, you need to change the language of your phone and ABSOLUTELY reboot so it can work.

Related

VSCode auto imports for React Native with JavaScript

I know VSCode supports auto import for JavaScript.
For some reason, it does not work with React Native. There is even a dedicated section on the VSCode website for this. But it only answers how to fix this problem for Typescript (using allowSyntheticDefaultImports). I want it for JavaScript (ES6).
I tried explicitly setting "javascript.suggest.autoImports": true, in my settings.json but that wouldn't change anything, since true is the default anyways.
How to get auto imports for React Native with JavaScript in VSCode?
PS: This plugin (suggested in this similar question) is also only for TypeScript. Besides that, since VSCode includes auto import out of the box there should be a solution without an extension for RN and JS.
You might have the 'Auto Imports' option disabled.
In VSCode go to Settings and search for 'Auto Imports' option, it should be something like this:
Just activate it if it's disabled and you'll be fine.
Install Auto Imports VSC extension, and enable Auto-imports options(for JS) in the VSC settings (File -> Preferences -> Settings).
You may try ctrl+space (for example, after placing the cursor inside the <Text> element) and select the import element from the displayed options.
For me the issue was neither the plug in nor VSCode.
I tried selecting suggestions with library name besides it and it worked for me. i.e if I want component then I will select Componet react from the suggestion and it worked.

KeyboardType - React Native

Have you any ideas concerning a KeyboardType for research. I searched and I didn't find any information about that.
In example, in Android, replace the button "Ok" by an icon or another text. Hope there is a KeyboardType specified for research. I don't really want to custom the Keyboard, I think it's not really so easy...
It need to work on IOS and Android
I you are using a TextInput component, you can try the props returnKeyType and keyboardType. They both customize the keyboard layout and works on android and iOS.

How can debug Nativescript app UI?

I am new to NativeScript technology, while developing application I need to debug the UI component like why this textview is not showing, layout is overlapping with another or find out other distortion in UI
Thanks for your time.
As mentioned in the other answer you can use the debug mode. I think things have possibly changed a bit since that answer, because you CAN to an extent debug the UI.
1) run the app in your emulator
tns debug android --bundle for example
this will output link such as chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40000
2) open the link in chrome.
Use Elements tab to view the xml tree of elements. You can alter and add attibutes to elements. example: right click on an element, click "add attribute" and add color="blue", this should change the font color to blue for the element.
<Label color="blue"...
you can view the computed CSS on the right side. However i don't think you can edit/modify the css on the right side as in web development.
here are the docs
https://docs.nativescript.org/tooling/debugging/chrome-devtools
Normally the only reason a field is off is if you are using margin with a negative value or you are putting multiple items in a absolute or grid layout cell.
To debug you can use:
tns debug ios --emulator
or
tns debug android --emulator
However using that you would be having to debug the JS code that builds the screen. You are much better off looking at the xml and understanding how layouts work to understand exactly how it lays it out. Then trying to debug what mistake you are making.

Custom android spinner/picker

I'm trying to add an android-like spinner to my mobile website. To put everyone in context the site is access via a WebView in an android application not from the phone/tablet browser.
Now the problem is adding a nice jQuery android-like spinner or spawning a native control that looks something like this:
Follow this link for image. Image taken from my phone on the Google calendar app.
I really don't want the solution posted here.
For several reasons:
- the plus button on top and bottom looks awful
- doesn't apply for other types of spinners that I have such as states (FL, CA, etc).
- I might need one, two or three spinners depending on the case
All those conditions completely discard the native DatePicker and I don't know if it's possible to get rid of the + things in it to make it look like the image above. If the case, that wouldn't solve the problem for the state spinner.
We also have an iPhone version of the app and we use cubiq spinning wheel but i don't want iPhone look-n-feel for the android version.
Thanks!
This one looks like a promising solution but I haven't tried yet.
http://mobiscroll.com/

How do you get the number keypad to come up in an iPhone web app?

On a web page that is to be displayed on an iPhone, is there a way to get the number pad to come up when the user taps in the field, instead of the qwerty keypad?
This guy says here's how to do it, but as of 2.0, this "feature" was disabled.
I'm guessing there's some fancy javascript to employ to get around this limitation?
If you use the HTML5 number input type, the keyboard will default to showing numbers. It's not the number-only keyboard, but it's a bit better than just text.
Yes, this used to be possible by including the word "zip" in your text field's name attribute. Unfortunately, Apple seems to have removed this in 2.0 and later. I suggest you file a bug.
You can make calls from JavaScript to Objective-C and then display what ever you want. If you want a framework to help you out you could check out QuickConnectiPhone. It is available at https://sourceforge.net/projects/quickconnect/.
You could also check out http://tetontech.wordpress.com. This is the develpment blog for QuickConnect. It has some example code in addition to that which is included in the sourceforge download.

Categories