Solved

simple button

Posted on 2012-12-30
1
467 Views
Last Modified: 2012-12-30
Hi, I am trying to add a simple button programatically and it is not showing up.
What is wrong with it ?

#import "xyzViewController.h"

@interface xyzViewController ()

@end

@implementation xyzViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    CGRect buttonFrame = CGRectMake(60, 60, 200,80);
    
    
    UIButton *button = [[UIButton alloc] initWithFrame:buttonFrame];
    button.layer.borderColor = [UIColor redColor].CGColor;
    
    [self.view addSubview:button];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



    

@end

Open in new window


.h file:


#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@interface xyzViewController : UIViewController

@end
 

Open in new window



I am testing it on IO6 iPhone/ipad simulator
0
Comment
Question by:sniger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
darbid73 earned 500 total points
ID: 38731936
HI sniger

give it a background color.

button.backgroundColor = [UIColor redColor];

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
"Reset" on Apple devices 2 88
Enterprise WhatsApp 1 40
Send Email from iOS Swift 3 2 39
Apple iCloud Accepting Meeting Reqeust causes issues 7 103
The Basics of Storyboard Storyboards were first introduced to developers in the release of iOS 5. They save the developer the trouble of designing each screen’s interface in a different file. The storyboard allows you to see the conceptual mockup o…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question