I was wondering if it was possible to change the fonts on about 100 different viewcontrollers all at once? It would be a lot eisier than going through one by one and changing them. Any ideas? Thank you!
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
you cant change all the fonts at once....
But i have find one more varient that will help you...
I have made some recursive functions thy can help you..
follow following steps..
First create a class(
BaseViewController
) extended fromUIViewController
like inBaseViewController.h
fileAnd in
BaseViewController.m
file write following code.Now your every viewController(RootViewController) will be extended from BaseViewController class like in
RootViewController.h
..And make sure that you have written following in your
.m
file of yourUIViewController
(RootViewController.m
)Please follow above steps carefully you will rock.......
The user interface files (*.xib) are plain text and you can load them into an editor.
In Xcode4 on the left pane you can right-click > open as > source.
This will give you the XML source any you can find/replace there.
Warning: doing something wrong may render the whole file useless, so unless you have source control anyway, make copies of the XIB before attempting changes.
Code by John Cromartie is a good stuff. Simple and laconic.
Just keep in mind some fonts are bold or italic. So you probably have to pass 2 (or 3) params: for regular font (as it is now), for bold font and for the italic one. Besides you have to detect if the current font is bold, etc. So there is a bit enhanced piece of code below.
However, it can work wrong on iOS7 because user can set his own fonts and, as a result, weight / style detection won't work properly.
https://github.com/iutinvg/ZZLib/blob/master/ZZLib/UIView%2BZZFontSetter.h https://github.com/iutinvg/ZZLib/blob/master/ZZLib/UIView%2BZZFontSetter.m
How about this little recursive method on UIView?