Can't scroll in my iOS application - ios

I'm pretty new in creating iOS applications and currently I'm following Apple's starter tutorial.
They suggest simulating on iPhone 6 which has a pretty big screen and therefore all the content fit its screen, however I'm simulating on iPhone 4 which has a smaller screen. All the content don't fit and I can't see all of the placeholder image. I'd expect that I would automatically be able to scroll so I'm able to view all the content but no.

It seems that you have designed your contents on normal view. Instead you have to use UIScrollView which will allow you to scroll to see all your contents. contentSize property is important for this.
Refer Here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/
The UIScrollView class provides support for displaying content that is
larger than the size of the application’s window. It enables users to
scroll within that content by making swiping gestures, and to zoom in
and back from portions of the content by making pinching gestures.

Related

UIScrollView scroll enabling

I'm currently working on a Swift app that requires a few UIScrollViews, however I'm running into some problems making it work for all device sizes.
In this situation, I would have a content that would all appear on an iPhone 6, but not necessarily on an iPhone 4 or 5.
I've got a scroll view set up with some content and I would like to make it scrollable only if you don't see the full content.
Is there a way to perhaps detect if a certain element is visible?
the property scrollView.isScrollEnabled = true by default, and if the content is bigger than screen the user will be able to scroll.

How to slideshow of ppt in iOS webView?

I am developing an iOS application to slideshow and even manually move slides of ppts(one slide at one time)upon a webview(in both portrait and landscape)using objective C.I have created buttons to move slides one by one forward and backward(one slide to appear at a time).Also,two separate buttons for autosliding and selecting animation types with which the slide show has to appear.I am using 'setContentOffset' method to move slides from one to another.
More importantly I need only one slide to appear in webview at a time and hence i have set the webview's frame size approximately to the height of a slide by merely observing with respect to the view controller's size.
The problem arising is in 'calculating the height of a single slide' and 'the variation in the webview's frame in different iPhones and iPads'.This slide height is further used to calculate the total number of slides in the ppt by dividing the content size of webview's scroll view by a slide's height.Since I am unable to calculate a slide's height exactly,I am ending with inaccuracy in moving slides one by one.Every time when 'setContentOffset' is called slide is moving by different amounts.
Please any one guide me in developing slideshow of ppt in webview with exactly one slide appearing at a time and this application must be supported in both portrait and landscape modes and with all iPhones and iPads.
Thanks in advance
This is the reference of the same for image view apply the same logic with slight modification in your case https://github.com/adamwulf/PowerPointToUIImage
hope this will help you !

WebView and Status Bar

When I run my web app WebView takes over the status bar, as in the picture:
http://imgur.com/JggYPP2
I'd like to be separated.
An example is this:
http://imgur.com/Zll2Oes
How can I set the WebView to have this effect ?
Sorry for the links , but I can’t upload pictures because I'm new
Both UIWebView and WKWebView classes inherit from UIView, which means we can boil down the problem as a UIStatusBar instance incorrectly overlapping a UIView instance.
If you are using Auto Layout in a Storyboard, create a constraint (with a value of 0) between the top of the Web View and the bottom of the UIViewController view's Top Layout Guide. By relating your constraint to the Top Layout Guide, your Web View will always respond to the status bar height should iOS designers ever change it.
If you are rendering the Web View programmatically and do not wish to you use Auto Layout, check into CGRectOffset and CGRectInset to manually set the frame of your Web View. At the time of this post, the status bar has a height of 20 points.
UPDATE 12/1/17
Preceding the introduction of the first iPhone with a non-rectangular screen (the iPhone X), Apple introduced Safe Areas in iOS 11 to manage a UIView's relationships with the boundaries of a device. In addition to managing physical boundaries of the device, the Safe Area observes software boundaries such as a virtual home button.
Unless your app requires custom drawing, I recommend relying solely on Autolayout going forward. Within a UIViewController, relate your subview's topAnchor to the UIViewController view's safeLayoutGuide.topAnchor, and so on.

IOS - How to get my text view object information to scroll on view?

I am using Mac OS X Lion 10.7.5 and XCode Version 4.6.1 (4H512),
I have looked at these answers on stackoverflow to try to figure out my question
-cannot make a text view scroll - xcode 4.3
-also posts that looked possible, when I searched on "scroll text in UITextView" within stackoverflow
Within Interface Builder I cannot figure out how to make information in a UiTextView object scroll within the iPhone simulator*. To resolve this challenge, I have made the most simple prototype project I can think of, just a view and one text view object on it, filling the text view object with a stream of text simply typed in via interface builder. For this most basic sample I'm using to sort out my problem, I have not done anything programatic. (Please note that I am aware of StoryBoards and have begun working through a book to learn to use them, but I would like to finish my first prototype app using what I’ve already learned and fully complete one project before I move onto my next project using StoryBoards.)
When I run this in the iPhone simulator, I see the sample information in my text view object come up. As I expected not all the information displays, due to my sizing the box a little too small on purpose. But I cannot flick or arrow down, or in any other way view the rest of the text information within the simulator. Nor do I see scrolling bars anywhere on the view. The information is just frozen in/on the view.
Inspector Settings
Identity Inspector
"Accessibility" Tested both with Enabled checked and not checked
Use Auto Layout is NOT checked
Attributes Inspector
Behavior Editable box not checked
Scroll View Area Checked ‘show horizontal scrollers, shows vertical scrollers and also scrolling enabled” The rest of the scrollers box are not checked
Bounces is checked
Zoom min and max are both 1
Touch all boxes checked- bounces zoom, delays content touches, cancellable content touches
View mode is ‘scale to fill”
Interaction ‘multiple touch’ is checked
Drawing checked opaque, clears graphics context, clip subviews, and autoresize subviews. Only ‘hidden’ is not checked
Size Inspector
I played around with the ‘scrolling insets’ boxes changing them from the default (I think it was 0 or 1), just to see if I noticed anything. I think maybe that I see some shadowy marker type lines in Interface builder in the area where I might expect a scroll bar when I make these changes, but no change in appearance within the simulator.
I cannot figure out why my actual iPhone device with everything up to date, is now not working as a test device, but I believe that is a separate challenge
how about wrapping you uitextfield in a uiscrollview. Make the scroll view the dimensions you currently are setting the uitextfield to, then allow your uitextfield to scale to the size of the text.
This is one of those questions that solved itself eventually. After twice creating the most basic app, with no programmatic bits just interface builder and a textView object with all the defaults the scrolling worked. The only reason I can think of that it might not have scrolled as expected the first time through may have had to do with placement of the textView object on the view. I wonder if it overlapped the bottom of the view and maybe that messes something up.
Just one of those situations where I had to keep plugging away, trying what seemed like the same thing repeatedly,set in the Inspectors, and suddenly, like magic, it worked. Except no magic involved.

iOS UIScrollView fine tuning

In Apple's apps I notice the scrolling is perfect. Everything moves nicely and when you stop, it stops. You can have a huge image and move directly to any spot and it stays there.
I'd like to provide the same UE, but for my apps, if the content exceeds the size of the scroll view (as it should - otherwise what's the point in having a scroll view?) the scroll view never stays put, you have to drag to see content on the edges, then it bounces back and hides it again. Very annoying, especially if there is active content like a button there.
I'm not an iOS expert, e.g. I just found out recently about how critical viewWillAppear is w.r.t. UIScrollView. Is there a concise reference somewhere on how to get perfect rock solid scrolling? (i.e. not Apple's Dev docs!)
Thanks for reading,
Yimin
Are you setting the contentSize property on the UIScrollView?
scrollView.contentSize = CGSizeMake(2000, 2000);
Apple has access to internals which we don't so its products tend to perform better. Scrolling in iOS is basically take it or leave it. Have followed the guidelines in the tutorials and they all have flakey scrolling, in particular the edges aren't always visible when zoomed.

Resources