ios - Obj-C, how to iterate all views for views with font properties? -
i'm trying survey (log) fonts , font sizes use in app, fonts / sizes, set programmatically or in nib files. afterwards, hope use code set fonts too.
(i aware of font type dynamics, i'm have auto layout issues.)
i've got far (see below), ideally i'd find font, mean navigation bar not buttons, labels or textfields.
maybe somehow check see if font method available ?
nsarray* buttonsarray = currentview.subviews; for((uibutton*) button in buttonsarray) { button.titlelabel.font = [uifont fontwithname:@"mycustomfont" size:16]; }
while asking if object responds font or setfont: technically working, have uiappearance system, designed give app consistent design. can things "all navigation bars should green", or "all buttons should blue, except contained in .... should yellow". many attributes configureable, , setting easy listing desired appearance patterns example in applicationdidload:.
http://nscookbook.com/2013/01/ios-programming-recipe-8-using-uiappearance-for-a-custom-look/ 1 of short introductions available on net.
the thing using instead of hacking while traversing view tree work views, didn't create far. if set manually, have after each view creation, tedious, wasteful , open bugs. also, you're less break things didn't mean to, third party classes.
Comments
Post a Comment