Я работаю над пользовательской клавиатурой для iphone 6 и 6Plus. У меня есть разработка логики для клавиши Shift Active-Inactive или 123 и клавиши abc. но я хочу также отображать пользовательский символ, например, показанную клавиатуру Apple. пожалуйста, проверьте изображение.
в настоящее время я могу изменить верхний регистр на нижний и 123 на abc, но как я могу установить этот специальный символ. ПРИМЕЧАНИЕ. - Я много искал демо на github, но не могу увидеть специальный символ ни на одной пользовательской клавиатуре.
Вот моя логика для верхнего регистра и кнопки ABC-123.
-(void)UpparCase:(UIButton*)sender // To make caps or small letter
{
sender.selected=!sender.selected;
if(sender.selected)
{
if(isPortrait)
{
[self.ObjKeyLayout.btnCapKey setBackgroundImage:[UIImage imageNamed:@"upparActive.png"] forState:UIControlStateNormal];
}
else
{
[self.ObjKeyLayout.btnCapKey setBackgroundImage:[UIImage imageNamed:@"Uppar_selctd_land.png"] forState:UIControlStateNormal];
}
for(UIButton *key in self.ObjKeyLayout.ArryCharKey)
{
NSString *uppercaseString = [[key currentTitle] uppercaseString];
[key setTitle:uppercaseString forState:UIControlStateNormal];
[key addTarget:self action:@selector(pressKey:) forControlEvents:UIControlEventTouchUpInside];
}
}
else
{
if(isPortrait)
{
[self.ObjKeyLayout.btnCapKey setBackgroundImage:[UIImage imageNamed:@"UpperCase.png"] forState:UIControlStateNormal];
}
else
{
[self.ObjKeyLayout.btnCapKey setBackgroundImage:[UIImage imageNamed:@"Uppar_land.png"] forState:UIControlStateNormal];
}
for(UIButton *key in self.ObjKeyLayout.ArryCharKey)
{
NSString *uppercaseString = [[key currentTitle] lowercaseString];
[key setTitle:uppercaseString forState:UIControlStateNormal];
[key addTarget:self action:@selector(pressKey:) forControlEvents:UIControlEventTouchUpInside];
}
}
}
- (IBAction)action123:(UIButton*)sender // To set 123 and ABC
{
sender.selected=!sender.selected;
if(sender.selected)
{
[self.ObjKeyLayout.btn123Key setTitle:@"ABC" forState:UIControlStateNormal];
int i=0;
for(UIButton *key in self.ObjKeyLayout.ArryCharKey)
{
[key setTitleColor:[UIColor clearColor] forState:UIControlStateNormal];
NSLog(@"\n\n123isSelected\nI-%i\tArrayCharKey.Count:-%i",i,(int)self.ObjKeyLayout.ArryCharKey.count);
if(isPortrait)
{
NSLog(@"\n\n123isSelected\nI-%i\tArrayCharKey.Count:-%i\nArraySpecialImageKey.Count-%i\n",i,(int)self.ObjKeyLayout.ArryCharKey.count,(int)arrspecialImageKey.count);
[key setBackgroundImage:[UIImage imageNamed:[arrspecialImageKey objectAtIndex:i]] forState:UIControlStateNormal];
}
else{
[key setBackgroundImage:[UIImage imageNamed:[arrSpecialIpad objectAtIndex:i]] forState:UIControlStateNormal];
}
[key setTitle:[NumKey objectAtIndex:i] forState:UIControlStateNormal];
[key addTarget:self action:@selector(pressKey:) forControlEvents:UIControlEventTouchUpInside];
i++;
}
}
else
{
[self.ObjKeyLayout.btn123Key setTitle:@"123" forState:UIControlStateNormal];
int i=0;
for(UIButton *key in self.ObjKeyLayout.ArryCharKey)
{
[key setTitleColor:[UIColor clearColor] forState:UIControlStateNormal];
if(isPortrait)
{
[key setBackgroundImage:[UIImage imageNamed:[arrKeyImages objectAtIndex:i]] forState:UIControlStateNormal];
}
else
{
[key setBackgroundImage:[UIImage imageNamed:[keyIpad objectAtIndex:i]] forState:UIControlStateNormal];
}
;
NSString *uppercaseString = [arrAlphabet objectAtIndex:i];
[key setTitle:uppercaseString forState:UIControlStateNormal];
[key addTarget:self action:@selector(pressKey:) forControlEvents:UIControlEventTouchUpInside];
i++;
// is123selected=NO;
}
}
}