creating dynamic buttons in iphone

Ads
 

creating dynamic buttons in iphone

i Have a UIView and i wanted to create a multiple buttons to that should come on view load. It will be great if that can be removed after sometime or required time.

View Answers

September 21, 2011 at 3:10 PM

-(void)mButtonclick{
UGFloat p=120;
    for(int i=0;i<3;i++){       
        UIButton *aa = [UIButton buttonWithType:UIButtonTypeCustom];  
        if(i==0){        
                NSString *name=[[NSString alloc][email protected]"ZERO"];
        }else if(i==1){
                NSString *name=[[NSString alloc][email protected]"ONE"];
        }else if(i==2){
                NSString *name=[[NSString alloc][email protected]"Two"];
        }else{
                NSString *name=[[NSString alloc][email protected]"Three"];
        }
    [aa setFrame:CGRectMake(0.0f, 0.0f, 500.0f, 40.0f)];
    [aa setCenter:CGPointMake(100.0f,p)];
    [aa setBackgroundColor:[UIColor blueColor]];
    [aa addTarget:self action:@selector(fullscreen:)   forControlEvents:UIControlEventTouchUpInside];   
    [self.window addSubview:aa];
    p=p+50;     
    }
}

//----------------fullscreen method--------------------
-(void) fullscreen:(id)sender{

    NSLog(@"button pressed on %@",[sender Stringvalue]);
}

Ads









Related Tutorials/Questions & Answers:
creating dynamic buttons in iphone
creating dynamic buttons in iphone  i Have a UIView and i wanted to create a multiple buttons to that should come on view load. It will be great if that can be removed after sometime or required time.   -(void
space between buttons iPhone SDK
space between buttons iPhone SDK  Hi, can any one please explain how to add space between UIButtons in iPhone SDK. Actually i am creating Multiple UIButton's and added them to my UIScrollView. But problem is that those buttons
Advertisements
Dynamic Array iPhone
Dynamic Array iPhone  Dynamic Array iPhone How can i add NSMutable array dynamically into my iPhone App
Creating Dynamic Tree
Creating Dynamic Tree   Creating Dynamic Tree: I have to build a tree structure with the following data lets say that with this data childId parentId 1 - 0 (lets say this is root) 2 - 1 3 - 1 4 - 3 5 - 3 6 - 5 7 - 6 all I need
How to create dynamic buttons for adding products on a cart.
How to create dynamic buttons for adding products on a cart.  Hi. I have some problems creating a page to add items into a cart. The page loads dynamic products from a database, and i would like to know how to group this products
write a program for creating html page with images and 2 buttons
write a program for creating html page with images and 2 buttons  write a program for creating html page with images and 2 buttons
problem in creating create .ipa file in my iPhone app
problem in creating create .ipa file in my iPhone app  Hi, does anyone have idea on how to create a .create .ipa file for my iPhone / iPad application? Also do i need to delete the previous build to create .ipa file? Thanks
Buttons
Buttons  I have created a web page with radio button group with two radio buttons for accepting the home appliances categories,Kitchen appliances and other appliances.I want to check for the appliance chosen when the required
Creating dynamic jsp file in java file to include another jsp file
Creating dynamic jsp file in java file to include another jsp file  I am able to create jsp file in java that includes ; table tr td and img tags..... Need to include jsp file in the same content. The below code doesn't help me
iphone
iphone  How can connect with the other database in iphone application(like... MYsql or oracle) is this dirctly possible
Creating Dynamic Tree component in RCFaces
Creating Dynamic Tree component in RCFaces... that how you can create a dynamic tree component with the use of RCFaces core tag v... a TreeDemo.java file which is responsible for creating tree and its child nodes
URL CODE OF BUTTONS
URL CODE OF BUTTONS   how to create a button tag, i need a details for creating a button tag with url code
radio buttons
radio buttons  write a program to create an applet button which has a list of radio buttons with titles of various colours.set the background colour... has a list of radio buttons with titles of various colors and a button
creating JD ialog
creating JD ialog   hi ... please help me in creatin a JDialog box that contains two buttons of minimization and exit
iPhone Capturing Screen SDK
iPhone Capturing Screen SDK  Creating an application to capture the screen shots from iPhone. In objective c is there any class that make it enable..?   UIGraphicsBeginImageContext(CGSizeMake(480,320)); UIImage* result
ModuleNotFoundError: No module named 'buttons'
ModuleNotFoundError: No module named 'buttons'  Hi, My Python... 'buttons' How to remove the ModuleNotFoundError: No module named 'buttons... to install padas library. You can install buttons python with following command
Sitemap iPhone Tutorial
iPhone | Objective C Tutorial | Objective C Introduction | Why... C on Mac | Compiling Objective C | iPhone Application Development... Inheritance | Dynamic Types in Objective-C | Objective-c memory management
Web Development for iPhone
Web Development for iPhone Developing Web apps for iPhone or any other... for desktop. A web app for iPhone needs special characteristics and developers must keep those characteristics in their mind while developing any site for iPhone web
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
3 RADIO BUTTONS
3 RADIO BUTTONS  3 RADIO BUTTONS USING ALSO ONE RADIO CLICKING HOW TO PROCESS OF NEXTPAGE
iphone tab bar
iphone tab bar  how to add tab bar items dynamically in iphone.../iphone/examples/iphone-tabbar.html http://www.roseindia.net/tutorial/iphone/examples/iPhone-TabBar-Application-Tutorial-UITabBar.html http://www.roseindia.net
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
iPhone 3G vs iPhone 2G
iPhone 3G vs iPhone 2G       Apple introduced the revolutionary iPhone 2G in Jan 2007 and since then the iPhone has captivated everyone's attention and hearts. The only
iPhone Graphics
iPhone Graphics  Hi, How to create iPhone Graphics? I am learning to crate UI Design for iPhone and iPad. Thanks
iphone avfoundation
iphone avfoundation  What is iphone avfoundation and why it is required? Can anyone show how to implement the AVFoundation in iPhone application with example or tutorial? Thanks
Iphone call
Iphone call  Do you have other method to make a call on Iphone,without openUrl
labels,textfields,buttons
labels,textfields,buttons  how to set the labels,textfields,buttons at certain positions such that we can add them without layout managers? my program is to design a login page with image and these labels at exact positions
pdf editor for iphone
pdf editor for iphone  hi i wanted help in creating a pdf editor for iphone. what are the steps needed to follow to develop the same? any help in this regard .. thanks
Iphone Tutorial
Iphone Tutorial  Hi, I am a new in this mobile applications segment. From where i will get the information about iphone tutorial or Iphone Development Tutorials. Please suggest the resouces......... Thanks
Creating a Frame
, calender, combobox checkbox and many more for creating GUI in Java based... with your applet. Swing libraries is used for creating desktop applications...; Creating a Frame     
iPhone
iPhone       Apple iPhone 3G is a multi-touch smartphone that has successfully combined multimedia, email, business and internet into a single platform. The iPhone

Ads