I am building an iOS app using Swift. In my app, I am using a paging menu controller (called PageMenu) built from other view controllers placed inside a scroll view (you can view it on GitHub here). It is similar to how Instagram looks:
When I set up the PageMenu in my project, it looks and works great...
BUT, when I embed the view within a Tab Bar Controller to add in a normal iOS Tab Bar, the scrolling within the PageMenu view doesn't work...and I get weird diagonal scrolling, and I can't actually scroll down if there is more content.
Does anyone have any idea of why this might be happening and how to fix it?
Please ensure that you set up the frame size when you are initializing the page menu.
If your scroll view is bigger than the actual view, then you will only be able to scroll the view, and not scroll the content inside it properly.
Set up the frame size of view while embedding. Check the parent view frame size.
Related
I'm trying to create a form that will be larger than the screen size and I've decided to use a view inside a scrollerview, then I'm adding the rest of the UI widgets (textfields, buttons, etc.) inside the view.
The view displays and scrolls, but no matter what I try, it displays with a vertical offset of -64 below the navigation controller bar. Once there the view will happily scroll up down.
I want the view to anchored at the top, just below the navigation bar, and then scroll down.
I am using IB.
Lots of time researching and not many answers that have worked for me. UIScrollView seems to be like one of those dirty secrets the whole iOS world seems to avoid....
Thank you for your help.
You can fix this in the storyboard
1- Select the view Controller
2- GO to attributes inspector
3- Uncheck adjust scroll View insets
For your view controller, in the storyboard uncheck the option to extend edges under top bar.
The drawing UI in IOS9 note app has a page control section on the bottom to choose colour (As shown in the attached image). I was wondering how can that be implemented? Does it use collection view at all?
You can implement it either by using collection view with paging enabled and add UIPageControl , or by using UIPageViewController embedded in UIContainerView which can be resized and placed anywhere inside your view controller.
I have the strangest thing happening. My Text Views and Image Views randomly become invisible on my View Controller.
I am developing using Xcode 6 on OSX 10.9
I have a View Controller that is wrapped in navigation controller.
In the middle of the View Controller I have Text View. When I add an Image View or move controls somehow the Text View disappears. It doesn't re-appear at run time. There doesn't seem to be overlap as far as I can find. On the left hand side the navigation shows that the text view is there and I can select it and edit properties.
Has anyone seen anything like this?
I recommend upgrading to Xcode 6, and using its new view debugging feature to locate your view. The issue could be with incorrect Auto Layout constraints, or some views overlapping one another, etc.
I have a view controller embed into a container view in iOS Xcode project. When I put a button at the bottom of this view controller it will not display in the container that is showing the view. My work around is right now is I added a scroll view. However I would like to get it to work without a scroll view (If possible).
Your button is not showing up indicates that the height of your view controller' view is greater than the display area for your view controller' view on the container view. Adjust your height to match the display height.
I have a screen that doesn't fit into a 3.5 inch phone screen. In iOS 6 I had the contents of the screen in a scroll view, but in iOS 7 that option is constantly grayed out.
Here is the screen shot
Would anyone know how to add the scrolling to my screen in ios 7?
Thank you!
Second screen shot with the scroll view.
Rather than selecting the entire view controller, you need to have a view selected. The options in Editor -> Embed In are contextual and since you have then entire view controller selected, your only options are to embed the whole VC within a Navigation Controller or a Tab Bar Controller.
If you can't get the right selection by clicking within Interface Builder, try expanding the outline view and selecting your view. Then try to embed your view within a scrollview.
Note that your root view must be a UIView, so you won't be able to embed the root view in a scrollview because that would put a scroll view at the root.
Three problems I ran into that I hope can help:
1) Make sure "Safe Area", or other object that shouldn't be there, isn't one of the objects selected in your view while trying to embed. For a simple test select just one simple object like a textfield or label and see if the Editor -> Embed In is still greyed out and work backwards if you have to.
2) You're going from View > Content to View > ScrollView > View > Content. So after embedding in a scrollview, embed in a view.
3) Once embedded make sure your scrollview is less than your content size, or it won't scroll: https://stackoverflow.com/a/28146729/1323357