How to make a UIImageView display full screen (Swift) - swift

I have a UIImageView in a UITableViewCell. When the image is tapped I want the image to display full screen and then when tapped again, to return to it's normal size. Do I need to create a new view for this? Thanks for any help

Yes, you have to create new view to show image in full screen.
First get frame of tapped image view with respect to self.view, then assign that frame to new view in which you have full imageView. Now with animation, show full image view, and again with tap back to its original frame with animation.

It's easiest if you create a new view. It's also easiest if you have a view controller with the table view as a subviews of the main view. Then you can create the new view as a sibling to the table, displayed over the top of the cell, and animate it's frame to full screen.

Related

View elements resize problem

I have a UiView which contains a UiWebview, UIButton and a UITextView as its elements.
I add this UiView to a UIScrollView and resize the frame so that the text view is not visible. When i click the button i resize the view to display the entire UIView including the UItextview.
The problem is , the text view appears below the view when i resize the frame. When i click expand it covers the text view too.
When view is first added i want the view to display just the webview and the button and when button is pressed it should display the text view.
How do i achieve it? Has it got to do with view hierachy?
you should enable clipping on the UIView .
edit:
I wouldn't resize the view. Instead I would just change the hidden-property on the textview. If you want to add some animations later then you can modify the alpha-property as well.

Overlaying a UIView on top of my existing view?

I have a view i want to overlay on top of another. It will be smaller and not take up the whole screen, and so it's important that the view behind can still be seen. How do i do this?
If you lay another view on top of an existing view and set the rect containing the new view to some size smaller than the screen, the view in back will still be seen. Just call initWithFrame:(your CGRect size) then your [mainView addSubview:newview]. This should add your new view on top of your existing one.

iPhone Setting A Background Image

I want to use an image as a background for my application. I want the buttons to be over the image. How is this accomplished? Everytime I use image view it covers up the buttons.
The image view should cover your buttons unless you are placing it higher in the list of subviews. Make sure your image view subview is added first and the buttons (and all other views) will be displayed on top of it.
Are you doing this in Interface Builder or manually in code?
You could try using UIView's sendSubviewToBack method:
UIImageView view = / init view */;
// some additional code here
mainView.addSubview(view);
// add buttons, etc...
mainView.sendSubviewToBack(view);

How can i move images on touch event?

I have created a image gallery. I show all images from plist file in navigation view. When i open image in full view after that i have to back in navigation. But i want to move images in scrolling when image in fullview. After open image in full view i want to swap one by one next as well as previous...
Is there possible..??
Plz give me help about any kind..
Regards....
Yes thats possible, make your fullview a scrollview with its contentsize having the same width as your screen and its height being the combined height of its subviews (put at least two or 3 imageviews in the scrollview as subviews). You can add and remove UIImageviews as subviews of the uiscrollview as the user vertically pages through them. You will need to communicate with the navigation view what the table status is when your user returns to that view though so that everything matches up.

Is there a way to resize TTThumbsViewController's grid?

I am using TTThumbsViewController to display a grid of thumbnails,
very easy. However the hard part is what if I want to display a custom
view at the bottom of the grid? And I don't want the view to be part
of the scrollable grid. How do I resize the thumbnail grid and then
attach my own view to this controller's view? Think of this view as a
custom toolbar kind of thing
You need to create a parent ViewController that contains the TTThumbsViewController and your own custom ViewController. If you need to programmatically resize the TTThumbsViewController you can access the actual view through the view property and sets it's frame property.