move a subview down when scrolling UITableViewController - objective-c

I have a UITableViewController with static cells.
I add a view in the lower left corner.
I wish for this subview to always stay "glued" to the lower left corner and come down/up with the user scrolling.
how can I achieve this?

Have a look at the link, it only requires very slight alteration to have a view stick to the bottom left corner instead of the bottom middle.
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AutoLayoutbyExample/AutoLayoutbyExample.html

Related

UIScrollView Horizontal Scroll Thumb in the Vertical Track

If an insane client had asked for this functionality, I would have told him it was impossible.
Yet here I have your everyday UITableView inside a UIScrollView, setup in Interface Builder. The scroll view has vertical scrolling enabled, but not horizontal. So what the heck is THIS:
Note the bottom right -- that capsule is the visible scroll thumb in a horizontal orientation. If you scroll the table view up and down, that thumb moves left and right... INSIDE THE VERTICAL SCROLL TRACK. The width of the track is the complete representation of the height of the scroll view's contents; I scroll to the top of the table view, and the thumb moves to the left, so I can just see the right side of that capsule shape.
This has to be some kind of weird bug, right? Any ideas how to shake this loose?
Looks like I posted too soon. I deleted the table view in IB and re-created it. The problem went away. Must have been some glitch in Interface Builder.

How to create layout in Titanium

How do I create a layout as in the image above in titanium?
When someone scrolls, I want the left and the right column to stay fixed to the screen (as in CSS fixed position) while only the middle column scrolls.
When someone taps on a button on either the left column or the right column, the buttons in the middle column are going to be replaced with new buttons.
.1 Create the base view that contains the left and right buttons.
.2 on top of that view, create a scrollable view transparent, with the learning, eating buttons on it.
// SCROLLER
var scroller = Titanium.UI.createScrollableView({
pagingControlColor:'transparent',
});
First of all, set current window's layout to 'horizontal'.
Then create left view(Ti.UI.View), mid view(Ti.UI.ScrollView) and right view(Ti.UI.View).
Set the layout of all of these three view to 'vertical'.
Now when you would scroll, left and right view will remain at same state while just mid view will be scrolled.
Hope it would solve your problem.

How do I expand a window to show more content in cocoa

I'm building an application in Cocoa and I want to be able to let the user click a button, which expands the window size showing content that was previously hidden.
For example, the top 68 pixels of my application show a summary of what is happening (like syncing data to a server) and there's a button off to the right that when clicked expands the window down and let's the user enter more information.
Problems I'm having are.
1) the background image I setup by subclassing NSImageView seems to be originated at the bottom left corner instead of the top left, so my button which should be over the right corner a the top of the background starts off over the right corner at the bottom of the background.
2) The window expands down and the button floats up. So the button starts at the bottom right corner and ends up at the top right corner. I want it to be in the top right corner always.
I think all of this would be solved if I could figure out how to tell the window to start at the top left corner and grow down, but not move controls around, simply hide them if the window isnt big enough.
Thoughts?
If I understand your question right then this should be it:
1) it is so because the coordinate system on mac is with the origin on bottom left. I think you should just move your image view up a little when you're resizing.
2) When you expand the window the buttons frame is based with the origin on the bottom left corner so again you will need to offset it when the view grows.
I think that by using auto layout and setting up the proper constraints things might be a little easier :)

Double UIScrollView synchronization - Different height

I'm currently developping iPad application with 2 UIScrollView in the same page.
On the left side, there is the content and on the right side, there are some bloc, news. These two UIScrollView are different height size.
Example : left 1000, right 2000.
I would like to synchronize the 2 UIScrollView, I explain me :
When the user scrolls on the left UIScrollView to access on the bottom, the right UIScrollView "scrolls" in the same time. If the left UIScrollView is happened to be at the bottom, and the right UIScrollView is NOT on the bottom, the right UIScrollView continue to scroll until ... it stop naturally.
And the same behavior if the user scroll on the right UIScrollView.
Do you have an idea how to resolve or to handle my problem ?
You have to listen to the delegate method of scrollViewDidScroll then you can set the contentOffset of the second UIScrollView.
I'll just post the solution I used in case anyone gets to this question in the future.
You don't set the contentOffset directly. You need to do a workaround. Like so:
CGRect viewToUpdateBounds = viewToUpdate.bounds;
viewToUpdateBounds.origin = scrolledView.contentOffset;
viewToUpdate.bounds = viewToUpdateBounds;
Regards

UIScrollview scrollable when contentView's size increases left and top

I have a UIScrollView- scv and a UIView - ocv that have been generated dynamically (no IB), I have added ocv as a subView of scv. Initially i set the content size of scv to the frame size of ocv. But at run time I have to increase the width of ocv because I keep adding subviews onto ocv that extend beyond the left boundary of ocv. Now when I set a new contentSize for my scrollView, It scrolls to show the right side of ocv while the content I want to see is on the left.
Same is the case with top. I keep adding subviews beyond the top boundry of ocv, but i cant scroll to see the top part, i can only scroll to see the bottom empty part..please suggest me a solution..
I believe it is simple. Can u please check if u have selected sc are being checked in your
Interface builder? If everything is fine there, then please increase the height of your scroll view namely scv and also specify your UIView and the additions of subviews to it through code rather than from Interface builder?