我想要创建这样一个自定义NSTextField/UITextField
输入一个软件键(请原谅我的绘画技巧)。
有人对我该怎么做有什么建议吗?
我的惰性解决方案是给它一个占位符字符串,中间有空格和破折号,当它们键入时,只需将这些破折号隐藏到字符串中。但是我想知道是否还有其他人有一些输入??或者我应该只使用标准的单独的文本字段。
发布于 2014-11-21 23:29:57
-(void)viewDidLoad
{
UITextField *firstPart = [[UITextField alloc] initWithFrame: YOUR_FRAME];
firstPart.placeholder = @"-";
firstPart.textAlignment = NSTextAlignmentCenter;
[self.view addSubview: firstPart];
// Create others
}
-(IBAction)unlockBtnPressed:(id)sender
{
NSString *softwareKey = [NSString stringWithFormat: @"%@ - %@ - %@", firstPart.text, secondPart.text, thirdPart.text];
}
https://stackoverflow.com/questions/27071208
复制相似问题