Height of my UIScrollView portrait and landscape - objective-c

Good morning,
I'm working with UIScrollView for the first time and I'm trying to make the height of the scroll as I have elements in my screen. In my attempt I can scroll through my View, but when I'm in portrait mode I have a lot of scroll and when I'm in landscape mode I have the exact scroll that I would have.
How can I make the scroll showing only my content? Because at the moment I set a height and the scroll is showing too much height in my portrait mode.
I will appreciate any help, because I have search some questions but I can't really go on with my project without that.
Thanks in advance.

Related

Reload round rectangle groupped tableview in Landscape mode

I am using Boris's answer (objective-C) for custom tableview with round rectangle border.
Screenshot 1
It is working fine. It shows border around my custom tableView cells. When I rotate device in landscape mode then it also rotates but doesn't auto-resize border.
I also have a sliding menu that opens tableview screen. If I open tableview screen again in landscape mode using sliding menu button then it redraws cell border before cell appears and shows border correctly in landscape mode. So I know it appears correctly in landscape mode too but only when it reloads screen.
Screenshot 2
It should also redraw it upon rotation.I am trying to achieve it from last 2 days but it is not working anyhow. I tried to call willDisplayCell method manually in landscape mode but no success. I tried to refresh and reload tableView but none worked.
How do I fix it? Any help is appreciated.

Zoom in and out with touch in Xamarin.Forms

I am new to Xamarin and trying to create a simple page. I have scrollLayout and grid inside. In the grid I have a frame and some text in frame. I deployed it on my andriod but when i try to enlarge the screen with touch(two fingers) it doesnt enlarge the screen. I want user to enlarge the text and read. Any help would be appreciated please..
Scroll layout doesn't have the feature for zooming in/zooming out entire view. It just scrolls your content when not fitting screen height / width.
To achieve effect you want you need two things:
Pinch zoom gesture support (https://github.com/twintechs/TwinTechsFormsLib, http://www.mrgestures.com)
Label.ScaleTo or Label.FontSize properties which are controlled with your gesture.

UIScrollView. How to use the scroll bar on the side?

I'm working with Xcode developing for iOS using a UIScrollView. I got the scrollview working just fine.
But my issue/question is dealing with how to use the scrollbar on the side of the scrollview:
For example, I have dynamically created 2000 buttons inside the scrollview, in the simulator. The buttons are lined up vertically, so I have to scroll down to see all of the buttons. I do not want to simulate scrolling 30 to 40 times in order to get to the 1500th button.
I have the code to go to the last button, and to scroll to top. But I was wondering if there is anyone that can give insights on whether I can use the scroll bar on the side of that scrollview in order to help me navigate the scrolling better.
That bad boy isn't a scroll bar. It's simply a visual indicator of the current location. There are ways to scroll programmatically, but I'm not sure that's really what you want to do.

UIScrollView auto scrolls to bottom during change to landscape orientation

I have a scrollview with 2 UITextViews (neither are editable). When a change to landscape orientation occurs, the scollview inexplicably scrolls to the bottom. This behaviour does not occur when rotating to portrait. I have tried setting the scrollEnabled property before rotation to NO, but to no avail. Any help would be appreciated please.
I eventually found that by setting the scrollview contentsize to 0 before rotation and restoring it during or after rotation prevents this unwanted auto scrolling

content offset for UIScrollView does not change while rotating and scrolling simultaneously

I have a UIScrollView with paging enabled.
Each page is of width 768.0px in portrait mode and 1024.0px in landscape mode.
If I am in the second page in the portrait mode, then the content offset for the UIScrollView is 768.0.
However, if I scroll to the next page and rotate the device to landscape at the same time, the content offset does not update and remains at 768.0 instead of the expected content offset 2048.0, giving wrong results.
Any idea on how i can invoke the scrollViewDidEndDecelerating: with the updated values?
Thanks in advance!
Check the rotation delegate methods for view controller which manages the scroll view. I'd suggest disabling user interaction while rotation is in progress (with willRotate... and didRotate... delegate methods) since you're doing frame resizing for scroll view and it's subviews.