iphone - How to create a new textView every time when clicking on the same button? -


i create new uitextview every time when user click on same uibutton.

i've tried write codes can create 1 uitextview only. glad if there's sample code can provided me out.

thanks in advance.

    uitextview *newtextview =[[uitextview alloc]init];     newtextview.frame=cgrectmake(0,0,100,100);     [textview addsubview:newtextview];     newtextview.delegate=self;     [newtextview release]; 

in case of code create new textview required overlap last 1 can see new . need create int y variable increase value everytime change y codinate of textview.

-(ibaction)addtview:(id)sender  {     uitextview *newtextview =[[uitextview alloc]init];     newtextview.frame=cgrectmake(0,y,100,100);     [textview addsubview:newtextview];     newtextview.delegate=self;     [newtextview release];     y = y + 100;  } 

then add on view want add using [self.view addsubview: yourview]


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -