Add image to UITextField in Xcode?

后端 未结 9 942
时光取名叫无心
时光取名叫无心 2020-12-23 08:41

\"enter

I need to implement the concept of dropdown in Xcode.

For

9条回答
  •  时光取名叫无心
    2020-12-23 09:21

    hey mate you want dropdown view then see this custom dropdown view ..

    1. http://code.google.com/p/dropdowndemo/downloads/list
    2. http://ameyashetti.wordpress.com/2010/09/26/drop-down-demo/

    and for this requirement use this code

    UITextField *txtstate =[[UITextField alloc]init]; [txtstate setFrame:CGRectMake(10, 30,170, 30)]; 
    txtstate.delegate=self; 
    
    txtstate.text=@"Fruits"; 
    
    txtstate.borderStyle = UITextBorderStyleLine; 
    
    txtstate.background = [UIImage imageNamed:@"dropdownbtn.png"]; 
    
    [txtstate setAutocorrectionType:UITextAutocorrectionTypeNo]; 
    [self.view addSubview:txtstate];
    

    and set your textfield border style none..

提交回复
热议问题