2

I am pretty new to iPhone development, so I don't know if this is even possible, but is it possible to customize a keyboard so it looks like a calculator? I know how to use inputAccessoryView to put buttons on top of the keyboard, but I would like to put the add, multiply, divide and subtract buttons on the side to make it look like a more standard calculator. Is this possible?

Thanks.

coder
  • 10,460
  • 17
  • 72
  • 125

5 Answers5

3

The Buttons

Check out CodePadawan: iPhone Glossy Buttons for programmatically created calculator buttons.

However, I would suggest using PNG images for the button backgrounds. You can extract the normal button backgrounds (I didn't find selected button background.) from iPhone UI Vector Elements (linked to from iPhone and iPad Development GUI Kits, Stencils and Icons) with Adobe Illustrator by making a selection, copy, new, paste, Object > Artboards > Fit to Selected Art > Save for Web.

CalculatorMemoryButtonBackgroundNormal.png & CalculatorMemoryButtonBackgroundNormal@2x.png

calculator memory button background normal calculator memory button background normal retina

CalculatorOperatorButtonBackgroundNormal.png & CalculatorOperatorButtonBackgroundNormal@2x.png

calculator operator button background normal calculator operator button background normal retina

CalculatorDigitButtonBackgroundNormal.png & CalculatorDigitButtonBackgroundNormal@2x.png

calculator digit button background normal calculator digit button background normal retina

CalculatorEqualButtonBackgroundNormal.png & CalculatorEqualButtonBackgroundNormal@2x.png

calculator equal button background normal calculator equal button background normal retina

The Implementation

Community
  • 1
  • 1
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
1

Since you are new to iPhone Application Development, I would say go to Youtube and watch tutorials on iPhone app dev, and it is of great resource. As for your "Calculator" project - visit this tutorial !

Legolas
  • 12,145
  • 12
  • 79
  • 132
1

Not in any simple way. Given how simple this keyboard would be, this is better achieved by building a custom view.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610
1

You will need a whole replacement "keyboard" with your own buttons and actions to do this. This will be a UIView holding a set of UIButtons. If you want this to pop up like the regular keyboard (as opposed to being on screen all the time like in the calculator app) then set your new view to be the inputView of your text field rather than the inputAccessoryView.

jrturton
  • 118,105
  • 32
  • 252
  • 268
0

Please see Custom iPhone Keyboard

However, it is possible that Apple could reject your app according to various SO posts on the issue.

Community
  • 1
  • 1
5StringRyan
  • 3,604
  • 5
  • 46
  • 69