草庐IT

uitextfield

全部标签

iphone - 如何将多个 UITextFields 添加到 iOS 7 中的 UIAlertView?

我需要在iOS7的UIAlertView上添加多个UITextField?myAlertView=[[UIAlertViewalloc]initWithTitle:@"EnterYourDetail"message:@"\n\n\n\n\n"delegate:selfcancelButtonTitle:@"Cancel"otherButtonTitles:@"Register",nil];txtEmail=[[UITextFieldalloc]initWithFrame:CGRectMake(30,40,220,25)];txtEmail.placeholder=@"emailaddr

ios - 子类化 UITextField

我想创建一个使用数字键盘并仅接受数字的文本字段,即使在粘贴时也是如此。目前,我有一个标题:#import@interfaceDRPNumberTextField:UITextField@end和一个实现:#import"DRPNumberTextField.h"@implementationDRPNumberTextField-(id)initWithFrame:(CGRect)frame{self=[superinitWithFrame:frame];if(self){self.delegate=self;[selfsetKeyboardType:UIKeyboardTypeNumb

ios 7.1 UITextField 色调颜色在 Storyboard中没有改变

在iOS7.0之前,文本字段的色调颜色更改为您在Storyboard中设置的颜色。从iOS7.1开始,它不会改变,除非您以编程方式进行。这是一个错误吗?有人知道吗? 最佳答案 这是使用Storyboard的解决方案。1)转到“身份检查器”2)在“用户定义的运行时属性”中添加“tintColor”属性3)设置所需的颜色。就是这样。或者,如果您想为整个应用程序的所有文本字段使用相同的色调,请使用,[[UITextField外观]setTintColor:color]; 关于ios7.1UIT

ios - 使用 Xamarin 捕获 iOS UITextField 清除事件

我想在按下TextView的(x)时执行一些操作(重置搜索)。是这样的:iPhoneperformactionwhenUITextField/UISearchBar'sclearbuttonispressed但我不知道如何用Xamarin做到这一点我有这个:tbkSearchOrder.ShouldReturn+=(textField)=>{ComboViewCtl.OnOrdersFiltered(this,tbkSearchOrder.Text);returntrue;};响应键盘上按下的“搜索”按钮。UITextField有几个与此类似的方法,但它们是方法,而不是事件、Actio

c# - UITextField PlaceHolder 颜色更改 Monotouch

我一直在尝试更改UItextfield占位符的颜色,但没有成功。我试过子类化,也试过修改Attributed字符串,但没有任何效果。这是我试过的子类。publicclassCustomTextbox:UITextField{privatestringplaceholder{get;set;}publicCustomTextbox(){}publicCustomTextbox(stringtheString){this.placeholder=theString;}publicoverridevoidDrawPlaceholder(RectangleFrect){using(UIFont

ios - 子类化 UITextField 并检测它何时成为或退出第一响应者

我将UITextField子类化,并希望在它成为第一响应者或辞去第一响应者时调用一个方法。我怎样才能做到这一点? 最佳答案 只需覆盖becomeFirstResponder即可调用您的方法。类似的东西,-(BOOL)becomeFirstResponder{BOOLreturnValue=[superbecomeFirstResponder];if(returnValue){[selfmethod];}returnreturnValue;}有关响应器方法的更多信息,请参阅此处的文档:http://developer.apple.co

ios - 如果我在 TextField 中写入,则启用按钮

当您在TextField中编写内容时,我在启用按钮时遇到了一些问题。如果TextField中没有任何内容,我会禁用它,但当您在其中写入内容时,我无法再次启用它。我有这样的东西:-(void)viewDidLoad{[superviewDidLoad];NSUIntegertextLength=[_Name.textlength];[_doneButtonsetEnabled:(textLength>0)];} 最佳答案 将委托(delegate)设置为UITextField并创建一个用于在ViewDidLoad中更改文本的方法,如下

ios - 如何禁用 UITextField 中的文本提示?

有没有办法像这样在屏幕上禁用UITextField和UISearchBar中无用且烦人的弹出文本提示?我该怎么做?我找不到对此负责的任何属性(property)。 最佳答案 如果您在InterfaceBuilder中创建了View,请单击文本字段,然后从属性检查器(6个图标中的第4个图标)中将Correction设置为No。这似乎对我有用。 关于ios-如何禁用UITextField中的文本提示?,我们在StackOverflow上找到一个类似的问题: htt

ios - 如何更改 UITextField 左 View 框架

如何更改UITextField中leftView的位置?我已经试过了,但是leftView位置没有改变UIView*view=[[UIViewalloc]init];[viewsetFrame:CGRectMake(10,10,15,15)];[viewsetBackgroundColor:[UIColorblackColor]];[self.urlBarsetLeftView:view];[self.urlBarsetLeftViewMode:UITextFieldViewModeAlways]; 最佳答案 要更改leftView

ios - 当我点击 UITextField 时如何显示 UIPickerView?

我从互联网上找到了很多示例代码,但也不起作用....任何人都可以告诉我下面的代码有什么问题?多谢。紧急求救//我的storeboard屏幕http://imageupload.org/en/file/209300/03.jpg.html//ThisisPickerViewTest.h@interfaceInputRound:UIViewController{UIPickerView*pvPickerTest;NSMutableArray*aryMaster;}@property(nonatomic,retain)IBOutletUIPickerView*pvPickerTest;@pr