Half screen page control IOS - ios

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.

Related

Weird scrolling behaviour when using Tab Controller - iOS

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.

Using Autolayout and universal storyboard super view is not taking the full screen?

I am developing an iOS application using Universal Story board and autolayout. The base views of my view controllers are leaving a space at the bottom and are not taking the full height of the screen. What could be the reason behind this?
Go to property area in the storyboard and choose your main view then select all the lines which is available in that area. then it holds the full view of the page.
It looks like your view is taking up the whole screen but is hidden behind a tab bar.
This will happen when you include them inside of a UITabbarController. The reason they reach down underneath the tab bar is because it is translucent (you can see a blurred version of the view through it).
This tutorial from Ray Wenderlich gives a good example and explanation of how to set this up in a storyboard.
https://www.raywenderlich.com/50308/storyboards-tutorial-in-ios-7-part-1
Actually the "Show Toolbar" option for my navigation controller was checked. The space at the bottom was taken by the toolbar.

tab view like button slides up

I am trying to have a button that is located on the bottom and when the user taps on it it will slide up to show the menu. How is this possible using code or is there an api or anything that I can use to make this possible in the easiest way?
Your screenshot shows a view whose frame is animated when the button is pressed so that either the height of the view, or more likely just the position, is changed so that the view becomes visible. This is a simple UIView animation and the view being added so it is hidden behind the button initially.
Check out the iOS documentation for Animating Views https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html
You should be able to create the view and its content either with the interface builder or in code. Start with the view off the bottom of the screen and then use animateWithDuration:animations: using the frame property.

Show first cell in UITableView just under the Topbar

I have an UITableView in a ordinary View controller with the Top-bar visible on an iPhone.
However, as per the screenshot below, the first cell in the table view is behind the Top-bar. How can I make it appear under the Top-bar while on the iPad, which doesn't use the navigation controller, and doesn't have the Top-bar it appears at the top?
if you use storyboards there is a nice option on the right (see screenshot). it is called extend edges - under top bars. if you clear the checkbox, your problem should be solved.

iOS7 - unable to embed a screen in a scrollview

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

Resources