Localisation and Autolayout - swift

I am trying to add arabic support in my app , but app has language button , if user selects arabic he can see arabic interface/resources right to left stuff even device language is english . Due to Autolayout I am felling bit issues here
Due to autolayout if i select device language arabic it switches all layouts right to left even app language is english , is there any way I can force to layouts from left to right always

I have been in this situation couple of times. Where we need to switch the layout based on a single language button. Yeah it gets little awkward when we are using AutoLayout. So you can do one of the following things :
You can disable the Autolayout & you should flip all the view
components based on whether user has selected Arabic or English. How
to do this is for english You need to concentrate on X value of frame
& then when its arabic start the X of the frame becomes
view.frame.width - X.
Second thing you can do is as #Kirsteins said you need to change the
constraints from leading to left & then trailing constraint to right
constraints. Thats not it you then need to change these constraints
programatically on the language change.
HTH :)

Related

Load Japanese Text into UIWebView

I'm making an app for read epub book with Japanese language. In general, web view will load text from html and display in web view from left to right and from top to bottom, but my app requires display text in web view follow text from top to bottom and then from left to right, so is there any solution for displaying text in UIWebView follow above format, thanks for your helps...
You're looking for the CSS property writing-mode: vertical-rl.
However, this is a broad topic. You'll probably need to tweak other properties such as text-orientation (to position non-CJK glyphs upright when necessary), text-combine (to group two numbers horizontally in a single character "cell", and so on.
In any case, beware, you are now in an alternate universe with basic concepts like "left" now changing their meaning on you.

iPhone keyboard in UIWebView, how to change the language of next/previous and done buttons

UIWebView's keyboard is pretty cool with its next/previous and done buttons. However, I was not able to find and change the button titles. The titles are always in english no matter in which language the system is running.
I have been looking for the answer to this for a while for my PhoneGap based application, and at last I found the answer here: UIWebview Localization.
The clue is to set 'CFBundleAllowMixedLocalizations' to 'Yes' in your info.plist. That really made my day :)
Unless you have your own keyboard designed by you which overrides stock one, you can't do that.
Stock keyboard's language is taken from iOS language setting (via Preferences > General > International).
You can set your own view on top of the keyboard. It is really easy after 3.2 and I have some sample code in this answer. That means you can use your own buttons and even set localized text there.
EDIT: That was a bad answer :) Sorry, I didn't see the 'mobile-safari' tag. But in my case, I also get localized versions of the keyboard previous/next buttons.

How to control the font size of html select boxes on iPhone

Regular HTML select boxes (such as, e.g. found here), while being "chosen" are presented by the iPhone on a native widget that seems to totally ignore regular html font sizes and whatnot. It does some ellipsing when it goes too long, but the font is way too big for a list I want to present -- even on landscape, only about 35 characters can fit.
Is there any way to tell the iPhone to use a smaller font there?
This is not possible. Use radio buttons instead.
Also, you can create custom select boxes. If created the good way, it works great. One small misstep and the UI is a disaster.

How to center text label in iPhone Settings application

When you look at Settings - General - Keyboard you can see text "Double tapping the space bar will insert a period followed by a space".
Question: how can I do something similar in my own app settings?
Got pretty close by using PSGroupSpecifier for text, but can't figure out how to center the text. Centering is the missing feature I'm now looking for.
No, you can't do that with AppStore Settings bundles.
You can fake centering by inserting a lot of spaces at the beginning.
(Centering the text is restricted to internal "preference bundles".)
changed for ios 4.0 - > make use for the footerText field of a group specifier.
follow:
http://developer.apple.com/library/ios/#documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/Articles/PSGroupSpecifier.html#//apple_ref/doc/uid/TP40007009-SW1
all you will need is in there.

iPhone keyboard layout for negative numbers?

My users need to enter latitude and longitude, and of course I need to verify that the values entered are legitimate lat/long value. I'd like to have a keyboard layout that does some of this for me (eliminating alphabetic characters, punctuation, etc, and leaving only the numbers and +/-). The number pad keyboard doesn't seem to do it (missing +/-) and neither do any other keyboard layouts that come with the SDK. Does anyone know if there is a way to provide that capability without doing my own keyboard IME and jailbreaking the phone?
Thanks!
I know this is answer is way late, but this topic was still relevant to me. Therefore I have hope the following will help someone who comes across this page.
Bryan S. Gruver posted a full Xcode project that lambdabunny could modify ever so slightly in order to achieve their aim. You can find it here:
http://brygruver.squarespace.com/blog/2009/10/1/creating-a-custom-number-pad.html
Update
The Squarespace link is now broken. Another option is:
https://github.com/lnafziger/Numberpad
How about placing a "+/-" button next to your UITextView that would switch the sign of the entered text? Or a "+" button that appears to the left of it that switches the button label from "+" to "-" each time you tap it.
You don't have to jailbreak.
If you create a view to simulate the keyboard you're still following the SDK rules.