iPhone, how do I create a transparent numberpad like this...? - iphone

How do I create a transparent numberpad view for a passcode view ?
Like this ?

I wrote a keypad, that is configurable through a delegate.
This method
-(UIImage *)backgroundImageForState:(UIControlState)state
forKeyAtRow:(int)row
andColumn:(int)column;
should return a transparent image.

The buttons on this keypad are custom buttons with corresponding images and black background color and they are made semitransparent.

Create a custom viewController that contains all the buttons necessary, and then find a way to hook it up to a custom uiview that will intercept the input, or have a delegate for it, and intercept the input from the delegate and put the text in a uitextfield (or whatever). If you want the apple keyboard to be show, I know of only one way: have users jailbreak their iDevices and create a custom keyboard skin and put it in a Cydia repo.

Related

iPhone keyboard on UiPopOverController (iPad)

i would to know if there is a way to show(call) an iphone-uikeybord-like inside a UIPopOverController. I've an ipad app with several functions, in one of these there is a button that show a popoover, inside the popover there are a uitableviewcontroller and a search controller for search functions inside the table; search stuff is numeric only and i want show a keyboard(like numberpad in iphone) inside the popover instead show the maxi ipad keyboard.
Thanks in advance.
Sure you can do that - but you'll have to build a custom keyboard.
I did exactly the same thing to create a numeric keypad after playing around trying to use a different UIControl for the text field input without much success.
My solution was specific to our app because we also wanted - and + keys to adjust the value without by tapping, but what I ended up doing was:
extend UITextField
add - and + buttons next to it
add a transparent button on top of the numeric field
trigger UIPopOverController when the transparent button was tapped
the popover loaded a NumericKeypad with it's own view
Although I usually try to use IB as much as possible in this case all buttons and target assignments were done in code (for easy of calculating relative positions in code)
The creation of the keyboard itself is really easy - it's just a bunch of buttons. You can either build in IB or programmatically - quite simple either way.

UISearchBar: Changing the appearance - Shape, Background, Overlay an Image

I'd like to change the appearance of the default UISearchBar. As an example, how would you recreate the search box in the Google iPhone app as seen below? How would you overlay an image to produce this effect?
(source: isedb.com)
Upon some investigating of possibilites to customize the search bar, I'm inclined to say this is a custom component that has nothing to do with UISearchBar, but instead recreates its functionality.
You don't need to subclass anything.
Create a new UIView that has the buttons and text field and then when then entire view is going to load do this:
[self.searchDisplayController.searchBar addSubview:customSearchBarView];
Make sure to set the new text field as the first responder so it has access to the keyboard.

How to realize the same effect like iPhone's homescreen

I want to add some custom buttons and realize the same effect like the iPhone's home screen. What I can think of is to calculate the position of each button and add them to the view. Are there any other ways to do this? e.g. add buttons to the tableview
Check TTLauncherView from Three20,
I realized the same view of the thumbnails in the photo app (which in principle differs only because of the background color and the rounded effect of the buttons) using a custom cell (with 4 UIButtons inside) in a normal tableview.
In my case, this is because I need to scroll up and down, in your specific case there should be a way to "lock" the table from scrolling. By the way, for this reason, it could be simpler to design the custom view in the interface builder, it is very quick to design such a view, and then create a custom controller to provide simple methods to assign icons and actions to the UIButtons dynamically.
You could also look at the Three20 libraries as already suggested, it is already implemented, but you app will easily be rejected by Apple if you do so.

iPhone dev: adding an overlapping label to the image

I'm trying to figure out a best way to implement the picture-editing capability shown in the native address book app on iPhone.
On the built-in address book, this is how the picture looks like before editing:
qkpic.com/2f7d4 http://qkpic.com/2f7d4
And after clicking edit, notice how "Edit" overlay is added and the image becomes clickable:
qkpic.com/fb2f4 http://qkpic.com/fb2f4
What would be the best way to implement something like this? Should I make the image a button from the beginning and have tapping disabled at first? If so, what steps are required to add an overlay/label to the image (in above example, gray border + the text "Edit" is added)
The easiest way is to use Interface Builder, create a container view, then add a UIImageView and UILabel as subviews to it. You would position and style the text and the image but set the UILabel to hidden. Make the whole container view respond to touches. It's easy to do since UIView is derived from UIResponder so all you have to do is override touchesEnded. Whenever you want to change the text label, just set the UILabel to hidden=NO.
There's more to it, however. Notice how the image has rounded corners? You'll want to override the UIImageView's drawRect method to implement a custom drawing routine to do that. There's lots of sample code around and it wasn't part of your original question so I'll stop here.

How do I programmatically make clicking on a UIImageView do something on the iPhone?

I have programmatically added a UIImageView. How do I make it send a message to my controller when the users clicks it, sending itself as the only parameter?
I wouldn't use a UIImageView unless there was some other compelling reason. I'd just use a custom UIButton and use the UIImage as its background.
Create a new class that extends UIImageView and use that.
In your class, override the touch events - touchesBegan, touchesEnded and/or touchesMoved as appropriate
From those methods, call back to a method on the controller.
I'd just put a custom button over the UIImage view, and use normally - buttons with Custom style are invisible and so will not obscure the image. It's also a great way to turn regions of text into clickable areas as well.
Or, you could assign the custom image as a graphic background for the button.
just put a button over the imageview, with the Alpha attribute set to 0.10 or less.
you can capture the button's tap event but almost cannot see it.