Display custom overlay image when button is pushed - ios

The Goal:
I would like to add a method to my UIButton which randomly displays the following;
An image in the middle of the overlay displaying a picture
A UIButton at the top-right (red 'x') that closes the overlay
Various UILabels with information
How would I go about creating an overlay, and how would I customize the layout of the overlay and assign values and images dynamically?
I know how to create a custom cell for a UITableView, but I need a bit of guidance on this one.

Use IB or create by program a UIImageView to contain your image on top of the overlay. Then just use the button to toggle the image view between hidden (property of UIimageview) and not. Alternatively you may position push the image view to top and put it down to the bottom of the view heap using the button.

Related

Center UIButton with image next to it

I'm trying to create a UIButton where the facebook icon is a part of the centering, however i can't seem to figure out how to make it part of the centering process. So far i've just created a UIButton with the text. I could just create a image next to it, however then it will not be part of the centering.
You can easily set image and title both for your button for different control state like normal,selected or highlighted etc.
So, set your image and title to your button from storyboard or programmatically there is no need to take separate imageview for image.
You can set edge insets for title and image both from interface builder or programmatically. you can manage top or bottom edge insets for title and image of button to manage it's vertical appearance!
check screen shot below,
Update : (as asked in comment)
For example,
this is the setup for my back button with image!
Provide button title and image for normal state. Then just change the left inset for image as per image

How to add tabs in the cell of tableviewController

hello I want to know how can I add tabs in the tableviewcontroller like this
I want to add tabs Contact and About similar to image and also a line between them. These tabs are in the mid of screen not at the bottom.
I have another question is when I press my thumb on this image portion and move my thumb downwards the image size increases. How can I do that. When I do in my controller white background comes up.
You could put buttons at the bottom of the cell and then have the button handlers reload elements in the cell's view.

Overlaying view with remove button

I have searched high and low, and maybe because of not defining the problem correctly, I can't seem to figure out how to achieve the following:
I want to add a overlaying transparent view with a remove button. Any thoughts or tutorials I can use?
I have looked at the following but I want to have it fullscreen with a remove button:
How to Implement a Cool Alert/Information Overlay on iPhone?
Just create a new UIView (let's call it OverlayView) in interface builder, with the size of the main view, and above the others, with clearColor background color. Inside that UIView put an UIImageView with the overlay image (it has to be a semi transparent png) and UIButton for closing (on tap remove the OverlayView from superview)

Make image view in iOS table view cell clickable

I have a dynamic table view in iOS 6. The table view cells have the subtitle style and show an image, a title and a subtitle.
The table view is inside a navigation controller, and in the navigation bar I have a bar button item which allows you to reset the progress information shown in the subtitle of the cell and in the image shown in the cell (grey image when progress is 0%, orange when bigger than 0%, green when 100%, the actual percentage is shown in the subtitle).
When the user presses the reset button, the image is replaced by a special image (a rounded arrow) which, when pressed, would allow the user to reset the progress and start the exercise from scratch.
The trouble is the image view in a cell is clickable but I cannot distinguish between a click in the image and a click in the text part of the cell (title+subtitle).
How can I do this? I'd better subclass and add a button, which is clickable?
Another consideration is that maybe the round arrow that resets should be an accessory view and appear on the right?
I would just use UIButton and add a custom background image. That should work, as you mentioned.

Grouping items inside a Scroll View using Xcode 4.3.2 and storyboards

I have a large image in a Image View, inside a Scroll View, in the View.
View Controller
View
Scroll View
Image View - 1750x3000image
Button - button1
Button - button2
Button - button3
Button - button4
When I zoom in and out, the button doesn't track with the larger image. Scrolling around, the button does track along with the image.
What I'm trying to accomplish is to have areas of the larger image be buttons, or have buttons hovering over those areas.
Based on what i can guess, you want your image to be like a button. Just add a UIButton custom type (frame same as the image view) with clear color background to your scrollview on top of the image view.
edit: Try adding the buttons as subview of the imageview, instead of adding it directly to the ScrollView?

Resources