我的应用中有UITextField
's 在 a 中UITableView
,我希望在点击它们时选择它们的文本,因为通常用户会希望在输入新文本之前擦除已经存在的内容。I have successfully done that, but the thing is when the text is selected, those ugly little blue "lollipops" used to select the range of selected text appear on the sides of the text. 如何让它们不出现?谢谢!
我的代码(qty 和 numberOfPeople 是UITextField
):
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
for (NSInteger i=0; i<n; i++){
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
CustomCell *cell = (CustomCell *) [self.itemTable cellForRowAtIndexPath:indexPath];
if ([textField isEqual:cell.qty] || [textField isEqual:cell.numberOfPeople]){
[textField selectAll:self];
}
}
}