Access value from dropdown
<p>when I access some value from drop down list in my textfield I have to press on that value for long to get that value in textfield.</p>

<p>So how can I access it easily with just one click on it?</p>

<p>Following is the code that I've used..   </p>

<pre><code>    txt_Recommend=[[UITextField alloc]init];
    txt_Recommend.backgroundColor=[UIColor clearColor];
    txt_Recommend.delegate=self;
    txt_Recommend.returnKeyType=UIReturnKeyGo;
    txt_Recommend.placeholder=@"--Select--";
    txt_Recommend.tag=6;

    [scr_View addSubview:txt_Recommend];

    btn_RecommendDropDown=[UIButton buttonWithType:UIButtonTypeCustom];
    btn_RecommendDropDown.backgroundColor=[UIColor clearColor];
    [btn_RecommendDropDown setTitle:@"" forState:UIControlStateNormal];
    [btn_RecommendDropDown addTarget:self action:@selector(RecommendDropDownSelect) forControlEvents:UIControlEventTouchUpInside];
    [scr_View addSubview:btn_RecommendDropDown];

    btn_Register=[UIButton buttonWithType:UIButtonTypeCustom];
    btn_Register.backgroundColor=[UIColor clearColor];
    [btn_Register setTitle:@"" forState:UIControlStateNormal];
    [btn_Register addTarget:self action:@selector(Register)                           forControlEvents:UIControlEventTouchUpInside];
    [scr_View addSubview:btn_Register];

    arr_RecommendName=[[NSMutableArray alloc]initWithObjects:@"BKmaker.ag",@"SBGGlobal.com",@"Bodog.com",nil];

    UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideDropDown)];
    [gestureRecognizer setCancelsTouchesInView:NO];
    [scr_View addGestureRecognizer:gestureRecognizer];

-(void)RecommendDropDownSelect
{
    dropDown=[[DropDownView alloc]initWithArrayData:arr_RecommendName  cellHeight:30 heightTableView:100 paddingTop:-100 paddingLeft:10 paddingRight:20 refView:txt_Recommend animation:BLENDIN openAnimationDuration:0.5 closeAnimationDuration:0.5];
    dropDown.delegate=self;
    [scr_View addSubview:dropDown.view];
    [dropDown openAnimation];

//    btn_RecommendDropDown.enabled=NO;   
}

-(void)dropDownCellSelected:(NSInteger)returnIndex
{
//    btn_RecommendDropDown.enabled=YES;
      txt_Recommend.text=[arr_RecommendName objectAtIndex:returnIndex];    
}

- (void)hideDropDown
{
    if ((dropDown != nil) &amp;&amp; (dropDown.view != nil))
    {
        [dropDown.view removeFromSuperview];
    }
}
</code></pre>
