2nd thread on this and yay NDA is lifted

Discussion in 'iOS Development' started by Chicken, Oct 1, 2008.

  1. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Right I need someone to tell me how to make a big red button in my app hopefully people can help more now that the NDA is lifted

    I already made a thread on this but no-one answered it!
  2. Nickll9009

    Nickll9009 New Member

    Joined:
    Sep 19, 2007
    Messages:
    1,367
    Likes Received:
    8
    Device:
    iPod touch
    dude its not that hard! google "UIImageView"
  3. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    right thanks at least i know what to google and if from getting the image on can i make it do a fuction when touched?????
  4. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    actually, i would recomment using UIButton. you can set an image as the background and/or set the color of it to red.

    this is off the top of my head it may be wrong!

    Code:
    UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setFrame:reasonableFrameForButton];
    [button setImage:[UIImage imageNamed:@"RedButtonImage.png" ForState:UIControlStateNormal];
    [self.view addSubview:button];
    
    [button release];
    For making it do something....

    Code:
    [button addTarget:self action:@selector(respring) forControlEvents:UIControlEventTouchUpInside];
    Code:
    - (void)respring {
            system("killall SpringBoard");
    }
  5. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    thanks gojohnnyboi i'll try both see what works best what headers do I need to include??? are they in UIKit???? if they're in UIKit I know which ones
  6. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55

    Yes, any iPhoneOS objects with the prefix UI are part of the UIKit, or UIKit additions or subclasses for specific applications. UIButton.h will allow you to use UIButton
  7. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    i think this works then

    Code:
    #import <UIKit/UIButton.h>
    hey I think i'm picking this obj-c up now its pretty easy once you get used to it and learn the basics
  8. Nickll9009

    Nickll9009 New Member

    Joined:
    Sep 19, 2007
    Messages:
    1,367
    Likes Received:
    8
    Device:
    iPod touch
    Hold the phone! You need more than just UIButton.h - wait for the toolchain installers for Leopard/Windows that are being released tonight!
  9. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    I really need to move onto the other features of this so what else do I need????

    It says there's no such directory as UIKit/UIButton.h????
  10. Nickll9009

    Nickll9009 New Member

    Joined:
    Sep 19, 2007
    Messages:
    1,367
    Likes Received:
    8
    Device:
    iPod touch
    YES... like I said wait until tonight!

Share This Page