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][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]);
}









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
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... file which is responsible for creating tree and its child nodes. Here is the code
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
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
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
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
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
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
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
creating JD ialog
creating JD ialog   hi ... please help me in creatin a JDialog box that contains two buttons of minimization and exit
3 RADIO BUTTONS
3 RADIO BUTTONS  3 RADIO BUTTONS USING ALSO ONE RADIO CLICKING HOW TO PROCESS OF NEXTPAGE
HTML custom buttons
HTML custom buttons  How can I make a form with custom buttons
iPhone Button Image
will set image on window when button is clicked. so to create iphone buttons...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 tab bar
iphone tab bar  how to add tab bar items dynamically in iphone.../iphone/examples/iphone-tabbar.html (adsbygoogle = window.adsbygoogle || []).push({}); http://www.roseindia.net/tutorial/iphone/examples/iPhone
iPhone 3G vs iPhone 2G
metal bezel. All the buttons, except the Home button, on the iPhone 3G... iPhone 3G vs iPhone 2G       Apple introduced the revolutionary iPhone 2G in Jan 2007 and since
iPhone Graphics
iPhone Graphics  Hi, How to create iPhone Graphics? I am learning to crate UI Design for iPhone and iPad. Thanks (adsbygoogle = window.adsbygoogle || []).push
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
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp
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
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
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
dynamic polymorphism
dynamic polymorphism  Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle, Ellipse, Triangle, Polygon, etc. Design a simple test application to demonstrate dynamic polymorphism
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
iPhone       Apple iPhone 3G is a multi-touch smartphone that has successfully combined multimedia, email, business and internet into a single platform. The iPhone
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.
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     
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
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
Dynamic keyword
Dynamic keyword  hi....... What is the dynamic keyword used for in flex? give me the answer ASAP Thanks  Ans: Dynamic keyword-> Specifies that instances of a class may possess dynamic properties added
NSZombieEnabled iPhone
NSZombieEnabled iPhone  NSZombieEnabled Trouble in setting How can i set the NSZombieEnabled in iPhone application to track unmanaged memory
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 '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