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.
Related
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.
As shown click the top three buttons will pop up a view on the basic view. What the view is? CALayer? Or just a small size UITableView? How to implement this?
the control is like a UIPopoverController - but UIPopoverController is limited to iPad only. here's a source which have generic/custom implementation that will help you creating similar view.
https://github.com/werner77/WEPopover
I belevie this is a custom view that contains a table view inside it. it is very simple to implement that, As this is not a full tutorial I can imagine the basic steps I would do:
the shape could be a combination of layers or more reasonable drawn with Quartz2D:
I would do it this way:
create view and draw the frame with a BezierPath in the drawRect:
+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius
draw the top black bar and the title on the top.
draw the top triangle and add to the view a property that will set the position according to the button position. then you could conditionally change the draw position of the triangle.
add a sub view of a table view and assign the view as a DataSource and a Delegate of it, and then do all the table view implementation.
Good luck
It's just a custom view. There is probably a UITableView embedded in the view for the friend request list.
is there a way to add a z-index to an image in xcode without having to create a new view. I'm pretty sure you can put the image into a new view and give the view the z-index, but I would rather do it without putting each image in their own views. Also, it must be programmatically, not using Interface Builder. I'm trying to stay away from using IB.
If by z-index you are referring to the order of subviews in a UIView, each subview has its own unique z index, so you'd have to create a new view for each image.
In my UIViewController that I use for my UIPopoverController, I have a label on top, a segmented control, and then a UITableView below it. When I created my .xib for the content view, I put in a table, and centered the label and segmented control within the .xib.
When I present the popover, I do not want it taking the whole screen. I use about (800,700) points to display the popover, but then the labels do not look right. They are not centered within the popover since the popover is now smaller than the .xib. What I did was move the label and segmented control to the left to make it centered in IB. That doesn't seem the best and future proof way of doing it. I was hoping I could do something programatically by taking the width size and dividing by 2 or something and centering based on that. Any advice? Thanks.
There are a couple of options:
Check out the documentation for the popoverContentSize property on the UIPopoverController, you should set it to be the size of the XIB that provides the content (so the XIB and popover both have the same size/contentSize, essentially).
Set the autoresizing masks on the subviews in the XIB so that they lay themselves out correctly dependant on the size of the XIB. To center them within their parent view you do NOT want the left and right mask setting (they should both be deselected in Interface Builder). This guide covers centering subviews: http://www.techotopia.com/index.php/IPhone_Rotation,_View_Resizing_and_Layout_Handling
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);