-3

how can I create functionality of custom fields.

Sathish
  • 43
  • 3

2 Answers2

1

before going to git , try to do it on yourself. 1.create an array(numeric-only) of images[1.img, 2.img,3.png......] or (alphabetic-only) array of images [a.img, b.img, c.img. 2.lets say you want only numeric. (a)take a view say keypadView, (b)Run a loop some thing like .Do something like this in for loop...

for(i=0; i<numericArray.count;i++)

{

    UIButton *numericKeyPadSingleButton=[[UIButton alloc]initWithFrame:CGRectMake(17+((i%3)*(104+5)), 67+(height*84), 104, 79)];
    [numericKeyPadSingleButton setBackgroundImage:[UIImage imageNamed:[numericArray objectAtIndex:i]] forState:UIControlStateNormal];
    [numericKeyPadSingleButton addTarget:self action:@selector(singleNumberClicked:) forControlEvents:UIControlEventTouchUpInside];
[numericKeyPadSingleButton setTag:i];
keypadView addSubiew:numericKeyPadSingleButton];

} finaly you can create a Done button also.

then your singleNumberClicked looks like this:

-(void)singleNumberClicked:(id)sender

{

if ([sender tag] == 0) {

    //1 clicked
    }

else if ([sender tag] == 1) {

    //2 clicked
    }
}

you can do it man try your self. Thanks

maddy
  • 4,001
  • 8
  • 42
  • 65
0

You can use https://github.com/kulpreetchilana/Custom-iOS-Keyboards library on Github.