Quote:
Originally Posted by ybrikeeg
great tutorial!! I was wondering if there was a way to make a "custom" picker in the sense of having the picker be pink instead of gray. And if there is anything else you can do to customize it.
|
Took some time, but I figured out how to add billTotal and tipAmount.
- Add a Label to your .xib file (delete the text "Label")
- Add (to your .h file) IBOutlet UILabel *totalAmount;
- In your .m file (below where the PickerView calculates the numbers) add this below "tipAmount.text....bla bla bla"
totalAmount.text = [[NSString stringWithFormat:@"Total: $%.2f", (tipTotal + [billTotal.text floatValue])];
That should be it. Now when you enter a bill amount and scroll the pickerview to the percentage you want to tip it will display the "Tip Amount" (as in the tutorial)... and, it will add the bill amount, tip amount and give you a total amount. Kinda confusing, but it works.