Discussion Forums  >  Uncategorized

Replies: 9    Views: 1174

rpwiki
Aspiring developer
Profile
Posts: 25
Reg: Jun 03, 2011
Requa, CA
250
06/08/11 10:31 AM (12 years ago)

iOS 4.2: Changing Description font type and line spacing

Is there a way to change the description font type (e.g. setting it to Georgia). Will I need to dig around in the code itself? Also, if a description runs multiple lines (which I'm trying to hard to avoid) is there a way to adjust the spacing between lines? Is this related to the row height / title height / description height properties?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/08/11 11:34 AM (12 years ago)
Good questions. Line height for the description is not adjustable per say. It's a bit complex but the idea is that the title takes up the 'top part' of the row and the description the bottom. The Row Height - the Title Height becomes the remaining space for the description. You could tinker with these to see if you can find a good balance. Sure you could dig around in the code but I'm worried that changing the code would mean ALL the meanu screens in your app would use the changes you coded. In other words, it would not be adjustable in the control panel on a screen by screen basis. For Font Style, a global code change makes sense. For title / description, tough call? In either case, these adjustments would be done in the BT_Objects / BT_cell_menuList.m file. This file is what created each row item in the lists. In this file you'll see a UILabel for the title and a UITextView for the description. These are what you'll want to tinker with. The titleLabel is created on line 93. It's font is set on line 310 The descriptionLabel is created on line 102. It's font is set on line 317. The change the font style, try something like: //make your own font above line 93, like just above. UIFont *titleFont = [UIFont fontWithName:@'Georgia' size:40]; [titleLabel setFont:titleFont]; (single quotes around Georgia are double quotes in Objective C, forum removes double qoutes) Do the same experiementing with the description label. iOS may or may not support all the font names that CSS may. Test test test
 
rpwiki
Aspiring developer
Profile
Posts: 25
Reg: Jun 03, 2011
Requa, CA
250
like
06/08/11 11:45 AM (12 years ago)
Thanks! I'm not as obsessed with line heights as I am with the font type. Typographically, I think it looks better to have a sans serif header and a serif body but am willing to give it up if it means messing around with code too much!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/08/11 11:50 AM (12 years ago)
Font-Fanatic - awesome!!! Tip: Don't lose sight of the fact that Apple has an opinion about your 'design' - sucks but true. They really REALLY like to see their standard fonts when applicable. This doesn't mean you can't get creative, just means you should keep it in mind.
 
rpwiki
Aspiring developer
Profile
Posts: 25
Reg: Jun 03, 2011
Requa, CA
250
like
06/08/11 11:54 AM (12 years ago)
Understood. There ideas about good design seem to be sporadically applied! Onwards.
 
Thekenman
Code is Art
Profile
Posts: 2
Reg: Jun 09, 2011
Miami
20
like
06/15/11 07:02 PM (12 years ago)
I am just getting started. This may be a dumb question but I am not able to add a description using my IPad. Am I doing something wrong? Keyboard will not come up when I tap screen in description box. Thanks.
 
rpwiki
Aspiring developer
Profile
Posts: 25
Reg: Jun 03, 2011
Requa, CA
250
like
06/15/11 08:15 PM (12 years ago)
Are you accessing the control panel via Safari on iPad?
 
rpwiki
Aspiring developer
Profile
Posts: 25
Reg: Jun 03, 2011
Requa, CA
250
like
06/16/11 03:03 PM (12 years ago)
UPDATE: TOTALLY got it to work! Changed at line 322 [descriptionLabel setFont:[UIFont fontwithName:@'Georgia' size:14.1]]; arbitrary size to see if it would work. Turns out it did! There is life as a wannabe coder for an ex-management consultant after all.
 
Thekenman
Code is Art
Profile
Posts: 2
Reg: Jun 09, 2011
Miami
20
like
06/16/11 06:58 PM (12 years ago)
Ipad.. Also. I guess I need a Mac to compile the app or is there another way around this?
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/19/13 08:03 PM (11 years ago)
Does this still work in BT2.0? Thanks, Jake
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.