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.

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]initWithString@"ZERO"];
        }else if(i==1){
                NSString *name=[[NSString alloc]initWithString@"ONE"];
        }else if(i==2){
                NSString *name=[[NSString alloc]initWithString@"Two"];
        }else{
                NSString *name=[[NSString alloc]initWithString@"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]);
}









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
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
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
iphone
iphone  hiii, how can we use table recursively in iphone
iphone
iphone  hello... i want to make first iphone application . How can i make it plz 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...;Here  we need a TreeDemo.java file which is responsible for creating tree
Hello World iphone Example
Hello World iphone with Example In the given tutorial you will be creating... of creating your first "Hello World" app in iphone SDK. As this tutorial... in Iphone SDK: 1. Creating a new project:     Double click
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
add Buttons in JavaScript
add Buttons in JavaScript  How to add Buttons in JavaScript
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
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
creating JD ialog
creating JD ialog   hi ... please help me in creatin a JDialog box that contains two buttons of minimization and exit
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
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
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
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
iPhone Button Image
is clicked. so to create iphone buttons on window will write the code...iPhone Button Image In this tutorial will learn how to Create iPhone Button image and also how to set the image on button click on the view, this will be done
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 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 Graphics
iPhone Graphics  Hi, How to create iPhone Graphics? I am learning to crate UI Design for iPhone and iPad. Thanks
HTML custom buttons
HTML custom buttons  How can I make a form with custom buttons
3 RADIO BUTTONS
3 RADIO BUTTONS  3 RADIO BUTTONS USING ALSO ONE RADIO CLICKING HOW TO PROCESS OF NEXTPAGE
Iphone call
Iphone call  Do you have other method to make a call on Iphone,without openUrl
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
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
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp
more Submit buttons in the same form
more Submit buttons in the same form  Can I have two or more Submit buttons in the same form
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
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
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     
Radio Buttons - Java Beginners
Radio Buttons  Hello Sir, How to create the code for the password recovery page(like forgot gmail password question and answer page)using the radion buttons in display the same page in jsp.I need only how to make the question
iPhone Quiz App Tutorial
iPhone Quiz App Tutorial In this simple iPhone quiz application tutorial, we are going to learn how to create simple quiz in iphone. Creating a simple quiz in iPhone is really easy..Just follow the given steps to create the quiz
NSZombieEnabled iPhone
NSZombieEnabled iPhone  NSZombieEnabled Trouble in setting How can i set the NSZombieEnabled in iPhone application to track unmanaged memory
DOJO+Creating button of same size.
DOJO+Creating button of same size.  I am trying to create two buttons in DOJO of equal size. But the size of the buttons varies depending upon the name of the button that will get displayed. I tried by giving a class atribute
buttons in netbeans,java
buttons in netbeans,java  respected sir, i would like to known how to make coding on a button while working on netbeans, so that a new window will open after clicking on that button? thank you   import java.awt.
iPhone Game Applications Development, iPhone Game Porting Services, iPhone Game Designing
iPhone Game Applications Development iPhone Game Development... the way we listen to music and download it, the iPhone has revolutionalized mobile and handheld gaming in multiple ways. Today the iPhone and iPod combinedly have
iPhone resignfirstresponder
iPhone resignfirstresponder  Hi, Provide me a good example of iPhone resignfirstresponder. I need a code to hide keyboard when use clicks outside the text box. ThanksADS_TO_REPLACE_1   Hi, You can use the following
java buttons - Swing AWT
java buttons  There are 3 buttons in a window....A,B,C.If a user clicks button A ,a clue is given to him leading to button B.After the user clicks both A and B,he clicks C which is a submit button.After this both A and B should
ModuleNotFoundError: No module named 'django-buttons'
ModuleNotFoundError: No module named 'django-buttons'  Hi, My... named 'django-buttons' How to remove the ModuleNotFoundError: No module named 'django-buttons' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'react-buttons'
ModuleNotFoundError: No module named 'react-buttons'  Hi, My... 'react-buttons' How to remove the ModuleNotFoundError: No module named 'react-buttons' error? Thanks   Hi, In your python

Ads