Hi, How can add a clearbutton (cross inside a circle) for text view like in text field?
Do you mean UITextField? Use the "Clear Button" drop down in the Attributes Inspector of the Interface Builder
If you want to do this in code you will have to use
textfield.clearButtonMode = UITextFieldViewModeWhileEditing
(or any of the mode from here)
There's nothing built in like there is for the UITextField. You'd have to add the view yourself (probably a UIButton) and place it correctly and also somehow get the text to wrap around it correctly. (And I don't think the latter is really possible.)
Maybe instead you should display a toolbar above the keyboard (or an inputAccessoryView
if you're targeting 3.2 and later) that provides a clear button.
just make a uibutton and put it on uitextview and set its action for clear text view;
uitextview.frame = (0,0,320,416);
uibutton.frame = (310,0,10,10);
[uibutton setimage:@"cross.png" forcontrolstate:uicontrolstatenoraml];
[uibutton addTarget:self action:@selector(clearButtonSelected:) forControlEvents:UIControlEventTouchUpInside];
-(void)clearButtonSelected{
uitextview=@"";
}
hope you want to clear the text view text when you click on cross button above is help if not understand then i can send you proper program for that