How to replace the default font for the whole OS - iphone

Is there a way to make my app override the current font of the currently foreground application?
What I have in mind is no matter which app is on foreground my app to be able to attach a button to the keyboard which will switch the font to a custom one thus overriding the current font for all ui elements(labels, buttons, text fields etc.).

What you're looking for is not allowed by Apple.
It seems it can be done for jailbroken devices though. It's difficult to tell how exactly they're doing it but I guess they meddled around with the images/colors provided by Apple for the keyboard and replaced them with their custom ones leaving the default un-recoverable.
Here's a blog about it too.

You can create a category on UIFont and replace systemFontWithName:size: and boldSystemFontWithName:size: with your own font. But this may have some weird side effects, as even alertViews and actionSheets are customized with that method..
edit: of course this works only in your own app.. you cannot change anything outside of your app.

Related

Default button highlighting in Flash similar to iOS UIButton

iOS has a default UIButton highlighting mechanism that really cuts down the preliminary design work needed to come up with a prototype. Does Flash have something similar?
Note that I'm not asking this for use on iOS, the question is for Flash apps that are going to be run on the web
Is not possible in flash by default. If you want to create a highlighted effect SimpleButton or MovieClip, you must create effect. using a MotionScript or Actionscripts effects must be implemented.

CTFontCreateWithName returning ".LastResort" font

I have multiple custom fonts provided with my app, all defined in the app's plist correctly. I can load UIFonts with those custom fonts with no problems. UILabels using [UIFont fontWithName:#"some-custom-font" size:14] as font work flawlessly.
What doesn't work is CoreText methods.
I need to use those fonts in attributed strings, so I absolutely need the CTFontRef. Till iOS 5 I had no problem what-so-ever. Now, CTFontCreateWithName tends to return a font called .LastResort, instead of what I need. If I kill the app and relaunch, some of the fonts that failed last time do work now, but others don't. Seemingly random. If I call CTFontCreateWithName immediately on app launch, that specific font works later, but again most of the others do not.
I never encountered this kind of behavior before. My app isn't very memory heavy. This feels like some iOS 5 bug. Any help or advice will be very welcome.
I've only used custom fonts via UIKit. You may want to contact DTS, or definitely bugreport.apple.com

Question on uikeyboard

Is it possible to change the uikeyboard button size for my application.
I mean i want to make the ui keyboard button size bigger..
Is it possible? can i change that?
If so please guide me out
No. You cannot customize the button size on a UIKeyboard. (Although note that the keys become larger in landscape orientation.)
You could, in theory, write your own keyboard; however, you will almost certainly be unable to provide localizations for every language (including non-latin languages such as Japanese). As a result, your app will almost certainly be rejected from the App Store.

iPhone keyboard return key

I need to customize the iphone keyboard. How can I do it? Also it is needed to place the return key of the keyboard with my project logo. How is it possible?
You cannot customize the apple iOS's default keyboard.
As such you can create a custom control similar to apple iOS's keyboard and make it look and customize as you want but then there ar more chances than not that your app may be rejected when you try to submit your app on the Apple's app store.
So it is not preferable to create custom keyboard.
Hope this helps you.
What have we done in one of our apps and you can do is create custom uibutton that is same size as return key, then register for UIKeyboardWillShowNotification and UIKeyboardWillHideNotification.
when one of those fire you should add/remove that uibutton to window with animation that tracks keyboard showing/hiding animation...
Ugly way to do it, but it served its purpose...
Some of the tutorials are incomplete or are much older. This tutorial works from IOS 4.3 onwards and I checked it. Save the two image graphics, and paste in the code. There is very little to change. Here is the link.
ps. I am not affiliated in any way with this article, but found it to be complete.
http://www.neoos.ch/blog/37-uikeyboardtypenumberpad-and-the-missing-return-key

should one customize default iphone controls?

my app asks the user yes-no questions, user replies using a uiswitch on screen. i've been thinking about creating a custom version of the switch that would display yes/no instead of on/off and would use a green/red background as an indicator of the value. after creating a mock up i'm not so sure this is the way to go. using the default switch doesn't feel right but so does changing it too much. what do you think?
It really depends; some custom applications have extremely custom UIs (such as ConvertBot, for example) and it works great for them. The risk is sometimes worth the effort. In other scenarios, custom widgets result in breaking usability. I don't think that changing 'ON/OFF' to 'YES/NO' is groundbreaking, if you do it right you can pull it off no problem.
I think if your mockup was better done (the slider should be divided into two to have YES AND NO of equal length with equal padding on both sides) it would look a little better.
From a user interface perspective, this is a bad idea. People have already learned the default switch, so why change it now?
Additionally, you run the risk of adding another source of bugs to your application that was not present before.
Depending on the app, this can be very valid. Sure people are used to the default controls, but changing the text or colors is not going to break the user's understanding of these controls. Its still the same switch underneath.
In your example you color both the Yes/No. That is the only concern I would have that you did change how the core switch works. Typically, it works with a highlighted color and a grey color. So, having it stay colored on both options could potentially be confusing.
Regardless, if you want to build your app this way, you should. Just because the iPhone offers great default controls doesn't mean developers shouldn't innovate and add their own or take the default controls to the next level.
Take a look at the custom UISwitch control that I built to allow me to change the background color of the control. You could use the same method to change the text, the font, or the text color very easily.
http://www.homick.com/posts/custom-uiswitch-control
The code is available on Github and includes a PSD that is used to build three different png files that the control uses. You can modify the contents of the psd to recreate the png files in whatever format you like. Swap those into the control and away you go.