views:

88

answers:

2

Hi,

I have a view and I hv a button on that.I need to have a drop down box on clicking that button. How to implement drop down box?? Drop down box shuold have a table view.When I click rows in table view(after drop down box will open) I want to get text which will be there on the clicked row cell on a view where I had button. How to do that?

A: 

there is two ways to do it just add one view on ur tableview and then put one tableview or show button on that so that it can see like drop down,call that method on table row selected of button selected on any cell

GhostRider
@GhostRider How to have the table view with the desired size on click of the button
Vijay
uiview *DROPDOWNView =[[uiview alloc]initwithframe:cgrecktmake(100,100,200,100); uitableview *tableview [[uitableview alloc]intiwithframe:cgrectmake(0,0,200,100)];[DROPDown addsubview:tableview];
GhostRider
@GhostRider The above solution is not working
Vijay
give me your id so i can show you image of same process
GhostRider
+1  A: 

There are two ways to achieve this

  1. By using tableview, you can have a tableview with the list of the items which you want to have in your drop down menu. Then in the UITableView's delegate method didselectrow you can have a checkmark for that particular row and then use that particular row's value elsewhere in the project.

  2. You can use Pickerview to achieve drop down list.

Among the two PickerView is advisable.

Atulkumar V. Jain