Screen/font-independent CGRectMake? (for iOS)

Hi,
I'm designing an app whose UI is created programmatically. I've found tons of examples controlling the position and size of controls through CGRectMake.
However, I believe this is not what I want, because CGRectMake uses "hard-coded" values for width and height that ignore things like the screen resolution, or the system font.
What I want is a way for programmatically creating a control so that its initial size is automatically adjusted so that the control has an initial beautiful appearance. So, it should be independent of both the device resolution and the system font.
Is there some place I should look at?
TIA

just.do.it wrote:
First, all coordinates in CGRectMake are points not pixels. So you can provide the same values on devices with "normal" displays and devices with retina displays.
Second, there's a method "sizeToFit" which can be used to adjust the controls size to it's content. For example you can create an UILabel, set it's font and text-property and than call [myLabel sizeToFit] to adjust it's width and height as needed for the current font / text.
Dirk
Thanks a lot, Dirk. One more question, though: I've searched for "sizeToFit", and I've read that it's currently implemented for UILabel only, while this method does nothing for buttons or sliders, and you've to override the method with your own implementation if you want it to work for such controls. Is that true? If affirmative, I think it's quite non-obvious to estimate the accurate minimum bounding box for a button, slider, etc, because they're not just the text label, but also graphics items, whose exact style may change accross iOS releases.
In other words, I believe my question could be reformulated like this: Is it possible to estimate the minimum bounding box for a UIButton, or a slider, or whatever, with a known label ("Push this button", for example) ? How?

Similar Messages

  • Cannot find font in numbers for ios

    I created a spreadsheet in numbers on my mac and just entered one number in one cell with the font helvetica.
    I then opened the spreadsheet on my ipad with no problems. I then closed the spreadsheet on my ipad and reopened it on my mac.
    I then went to a neighboring cell and entered another number in the font calibri and saved the spreadsheet to the cloud.
    When I opened the spreadsheet on my ipad I get the "Some changes were made to your spreadsheet" message saying the font calibri is missing.
    Of ourse I can open the spreadsheet by clicking on open and the calibri text is converted to helvetica(calibri).
    I closed the spreadsheet on the ipad and reopened it on the mac and changed the calibri text to helvetica.
    No matter what I do, including deleting the column that the calibri cell was in, I cannot get rid of the spreadsheet details and error message. What can I do to be able to open a spreadsheet without getting the missing font message?
    Also, I have a spreadsheet with 10 tabs on it that does the same thing. Is there any way to find out which cells have calibri in them.

    Hi feaco,
    I have a similar issue with a spreadsheet that is mostly used on iOS 7, no iCloud. Since there are other missing  fonts I ignore the issue. Sure would like to turn that warning off.
    I think this is an iWork for iOS issue. You may have better luck on that forum.
    quinn

  • Fonts in mail for ios 5 ipad?

    Hello, I have just downloaded ios 5 for my ipad 2 , I was expecting mail to include fonts, as the ios 5 new features specify. However, I am unable to find the font options. Am I missing something? Thank you.

    Disregard this discussion, please. Found it. You've to select the text and then it appears the bold, italic, underline option. Thanks.

  • Fonts not embedding for iOS app in App Store

    Hi all,
    I'm having an issue using embedded fonts. Currently, I use 6 or so font files throughout my app. These fonts all display properly in the AIR simulator, as well as developer builds installed on the actual device. The problem comes about when I make actual builds for the App Store. The only thing I'm changing is the provisioning file and certificate, and yet none of these fonts display correctly. It looks like it's defaulting to Arial or something, like when you set embedAsCFF incorrectly.
    I'm currently waiting on a build to be approved where I can switch between two versions of the fonts, one as embedAsCFF=true, the other as embedAsCFF=false.
    Because the stock SDK wasn't working, I'm using Apache Flex 4.11 SDK, with AIR 13 beta and I'm SURE that I installed the Font Embedding tools with the SDK. I just realized while writing this post that Flex 4.12 is now available, so I'll try to download and make a build with that.
    Does anyone have any idea why these fonts would be missing when going from the developer build to the App Store build? The intensely frusterating thing about this is that everything will work in the test builds, and a week later when my update makes it to the app store it isn't working and I have to wait another week to try to fix it.

    Don't worry it's not your device.  A lot of people using IO5 are having this problem for the past 6 hours.  Apple should address it soon.  If you need to search for apps you can either google the name of app in Safari and click on the link.  This should open the app in the App Store.  Other work around is if you have a program like AppShopper it will let you do a search that opens the App in the App Store. 

  • Screen font size in bridge cc windows 7 not adjustable?

    Having installed New CC Version yesterday i was kind of amazed about the screen font size especially for the file tree and the file folders on the left of the screen in Bridge (Windows 7). Is there a way to change the size of those screen fonts besides via the system fonts adjustnent that doesn't help in Bridge? Thank you.

    Unfortunately this will require some new programming by Adobe and there's no way to know when that will happen. In the meantime, the only option I think you have available to you is to change your resolution so that your monitor is using fewer pixels per inch.
    Kinda blows the whole value of the newer monitor but I suppose you can switch back and forth from low res when you are working in Bridge to high res when you are working in PS.
    Sorry, but for the time being, that's about it.
    Best,
    Gary

  • What is the font Apple uses for the time and date on the lock screen in iOS 7?

    I can't find the answer on Google. What is the font Apple uses for the time and date on the lock screen in iOS 7?

    This font. It's weird, it looks different when viewing the screenshot on my iMac, than it does on my iPod touch. Probably because of the retina screen of the iPod.

  • I need fonts khmer to install IOS 7.1 for read khmer  Facebook app.

    I need fonts khmer for IOS 7.1  to read  khmer language  for Facebook app. I have fonts khmer for IOS 7.0 but not work IOS 7.1  could not read Khmer

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.

  • (Resolved - My own stupidity) Remote Desktop 8.1.3 for iOS (iOS 8.0) - Connects to Black Screen

    New version, new problems!
    After finally solving my problems with connecting introduced in 8.1.0 for iOS, I have updated to 8.1.3 and have a new problem!
    I am able to log in, but upon login, I am presented with a black screen instead of my desktop.  If I turn on the mouse pointer, the pointer shows up, but it does not control the remote computer.
    Additionally, the iOS Remote Desktop Client is not "taking over" the remote computer... I am typing on the computer to write this, while my iPad's Remote Desktop app is supposedly "connected" to it.
    Anyone else having this new issue?

    Resolved - My own stupidity!  :-P
    Garbage in, garbage out!  I have two computers connected to the same monitor...My 2nd computer was active on the monitor, hiding the fact that my primary computer (and remote desktop host computer) needed a restart!  I restarted, and the issue
    was resolved!

  • Embedded fonts not working in Air for ios

    hi
    am building an ActionScript mobile project 4.6 for ios and want to use embedded fonts for my app.
    we are using the swf method for embedding the fonts , after loading the xml and even got the embedded resourses from swf , the output is not showing the exact font used , instread it is displaying one of default ios fonts in place of it...
    here is the code of my embedded fonts and we are using TLF for text output:
    ....inside my loaded swf: -
    package
        import flash.display.Sprite;
    import flashx.textLayout.compose.ISWFContext;
    public class Slide1 extends Sprite implements ISWFContext
            [Embed(source="C:/WINDOWS/FONTS/ariblk.TTF", fontName="Arial Black", embedAsCFF = "true", unicodeRange="U+0041,U+0072,U+0069,U+0061,U+006C,U+0020,U+0062,U+006F,U+0064", mimeType="application/x-font")]
            public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*
                  if (returns)
                          return fn.apply(thisArg, argsArray);
                  fn.apply(thisArg, argsArray);
    please help asap!
    thanks

    hi
    am building an ActionScript mobile project 4.6 for ios and want to use embedded fonts for my app.
    we are using the swf method for embedding the fonts , after loading the xml and even got the embedded resourses from swf , the output is not showing the exact font used , instread it is displaying one of default ios fonts in place of it...
    here is the code of my embedded fonts and we are using TLF for text output:
    ....inside my loaded swf: -
    package
        import flash.display.Sprite;
    import flashx.textLayout.compose.ISWFContext;
    public class Slide1 extends Sprite implements ISWFContext
            [Embed(source="C:/WINDOWS/FONTS/ariblk.TTF", fontName="Arial Black", embedAsCFF = "true", unicodeRange="U+0041,U+0072,U+0069,U+0061,U+006C,U+0020,U+0062,U+006F,U+0064", mimeType="application/x-font")]
            public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*
                  if (returns)
                          return fn.apply(thisArg, argsArray);
                  fn.apply(thisArg, argsArray);
    please help asap!
    thanks

  • Published for iOS, sound plays but no screen.

    Hi,
    I have completed a new game that runs great on Android - created using Flash Builder 4.5 and Flash Professional. I got all our Apple stuff out of the way and then also compiled for iOS. Then I deployed to my son's iPod Touch 5 via TestFlightApp.com. He installed and ran and we get the sound but no screen. I'd really like to finish debugging and then deploy this app for both droid and iOS at the same time (in the next few days). Can someone tell me why the SWF's that are the UI of the app are playing sound but not showing up on screen? How can I fix this problem?
    BTW, please forgive the fact that the site is under dev (will be completed and polished before go live), but you can get some idea of what the game is about at our web site: headshotgame.com.
    Best,
    Al

    Ooops, spoke too soon...
    After we recompiled all our FLA's to SWF's and added them as assets to our Flash Builder project, it did not work again (SWF sound plays but no graphics display). So, we went back to the earlier test solution and it did not work  either?!?
    Finally, we compiled using the quick compile selection of Flash Builder. The intro screen showed up all the sudden! But, none of the buttons work and you can't navigate to any other of the screens. Sadly, this is not answered and I don't know whether this belongs in the Flash Builder or the Flex forum as I don't know what is causing the problem.
    All of this works perfectly on Android. Same code on iOS does not work. Perhaps it's the fact that I'm testing on an iPod touch with iOS5?
    I have people waiting to test this app and help me get it live but I can't seem to get it to run on iOS. Please let me know if I can provide any other info to help you help me.
    Thanks!
    A summary of our problem:
    We have multiple SWF's that are compiled in Flash Pro that make up a larger mobile app that we built in Flash Builder.
    We add the Flash Pro SWF's to Flash Builder as assets of the project and use the Navigator to move between them with event listeners bubbling up from the buttons that are in the SWF's.
    There are many SWF's - most screens have multiple SWF's on them.
    All of this works very well on Android.
    The same project compiled for iOS creates an IPA file but when the IPA file is deployed to the device, none of the screens show up but the sound plays.
    There is only one way to get a (the first) screen to show on the device which is to set Flash Builder packaging method to "fast". Yet, getting the screen to show is useless as it won't allow you to navigate (and the SWF behaves differently in other ways compared to Android).
    I am testing on iPod and will recruit other iOS device users to test as well. The iPod I am testing on is an iPod touch with iOS 5.

  • HT201210 I was trying to update my ipod for ios 6. It got downloaded but could not update my ipod. my ipod screen is now showing one message usb -up arrow-itunes, can anyone suggest something please.

    I was trying to update my ipod for ios 6. It got downloaded but could not update my ipod. my ipod screen is now showing one message usb -up arrow-itunes, can anyone suggest something please.

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • The font in the URL address line is too small. How do I make it bigger? My computer screen is already set for maximum size.

    # Question
    Since Firefox last updated to a new version, the font in the URL address line is too small. How do I make it bigger? My computer screen is already set for maximum size.

    See http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files
    Add code to [http://kb.mozillazine.org/UserChrome.css userChrome.css] below the @namespace line.
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #urlbar .textbox-input-box {font-size:13pt !important;}
    #searchbar .textbox-input-box {font-size:13pt !important;}
    #FindToolbar .textbox-input-box {font-size:13pt !important;}
    </nowiki></pre>

  • How to use lock pattern for ur home screen in pod touch 4g(ios 5)

    how to use lock pattern for ur home screen in pod touch 4g(ios 5)

    Video formats:
    H.264 video up to 720p, 30 frames per second, Main Profile level 3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
    Support for 1024 by 768 pixels with Apple VGA Adapter; 576p and 480p with Apple Component AV Cable; 576i and 480i with Apple Composite AV Cable (cables sold separately)

  • HT201365 the activation screen(set up screen) for ios 5 and 6 kinda looks better than ios 7 and 8

    the activation screen(set up screen) for ios 5 and 6 kinda looks better than ios 7 and 8

    So what? Do you want a prize for posting such an illuminating comment?

  • Will Apple bring back black font for iOS 7?

    Please make an option available to change the font to black in iOS 7. The white font is so hard to see against most wallpapers and in the darker text bubbles.

    Sorry but you are not speaking to Apple here as these are user to user forums. If you wish to express your opinion to Apple directly then you can provide them feedback at the link below:
    http://www.apple.com/feedback/

Maybe you are looking for

  • IMac External Monitor stopped working

    I have an Intel based iMac and have been running my old 17inch apple monitor as a second display for over a year now. For no apparent reason today the monitor stopped working. The screen just appears black. there is power getting to it as the power l

  • Audigy digital out to pioneer vsx-1015 A/V receiver/amplif

    Hello, I have audigy 2, it has the digital out 3.5mm streo connector, when I connect it with 3.5mm stereo plug - > RCA chord, and the RCA plug into my amplifier, it produces no sound at all. I have set audigy to pass through mode, but nothing happens

  • New to Mac and CS4

    I am new to both Macs and CS4. I just got a Mac, and today I was installing CS4Master Suite. There are 4 Application disc, and they loaded ok. There is a 5th disc, which is labeled "CONTENT". When you pop it in, no pop up window tells you where or ho

  • HT4275 how to increase battery life

    My battery life suddenly decreased substantially.  Just in the last couple of days

  • Displaying photos in itunes.

    I want to display my pics i have on my itouch in itunes.I searched and found that in the photo tab in tunes that you have to check the full resolution box, but i tried tunes 9.1 and now 9.2, but when i open the photo tab there is no box. also my tune